The configuration is not exported

Created on 24 January 2023, almost 2 years ago
Updated 12 February 2024, 10 months ago

Hi there,

The module does what it promises, but I was a bit surprised, that all the settings which is there is not being exported in configuration.
Such behaviour is unexpected and it is causing issues with deployment. Is there any reason why it is not in config? Is it possible it is a bug?

Tried it on D9.5.2. with PHP 8.1.

Thanks a lot.

🐛 Bug report
Status

Needs review

Version

1.2

Component

Code

Created by

🇨🇿Czech Republic Petr Illek

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • 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'));
    } 
  • 🇮🇳India sunilpawar Pune

    @petr-illek

    Do you have PATCH for it ?

  • 🇺🇸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 11 months ago
  • 🇺🇸United States earthday47 New York
  • Status changed to Needs review 11 months ago
  • 🇺🇸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.

Production build 0.71.5 2024