- Issue created by @Petr Illek
- 🇮🇳India sunilpawar Pune
We are storing the additional setting for the domain in a state like this.
function _domain_login_restrict_config_submit(&$form, FormStateInterface $form_state) { \Drupal::state()->set('domain_login_restrict_enabled', $form_state->getValue('domain_login_restrict_enabled')); \Drupal::state()->set('domain_login_restrict_assign_domain', $form_state->getValue('domain_login_restrict_assign_domain')); }
- 🇺🇸United States thejimbirch Cape Cod, Massachusetts
I ran into this today. The configuration for the two settings is not exported.
Will try to find some tie to investigate.
- Assigned to earthday47
- Status changed to Needs work
10 months ago 4:48pm 9 February 2024 - Status changed to Needs review
10 months ago 5:57pm 9 February 2024 - 🇺🇸United States earthday47 New York
I'm happy to help and supply a patch! I added MR 6 which converts State into configuration. I've also attached a patchfile to this project.
Note that in this patch I've saved all the domain-specific configuration into the same domain_login_restrict.settings configuration object. Ideally, these config would be saved as 3rd party settings on the domain entities, but that's something that could be tackled in a future update.
- 🇺🇸United States thejimbirch Cape Cod, Massachusetts
Thanks for the patch Wes, and the knowledge that states are only saved in the database, not in config!
I will test this on my project next week!
- First commit to issue fork.
Added removal of state after config is created. New patch attached.
Note that when domain was previously created, had configuration saved in state and then was removed, its configuration is still saved in state and will remain there as there is no longer domain by which we can find that stale state now. Not sure how to solve this.
I guess it is the same for new config approach. It will too get stale when domain is removed later, but we can resolve that one in future when moving configuration to domain.