Config is not exported to split folder when only current status is active.

Created on 3 August 2023, over 1 year ago
Updated 7 August 2023, over 1 year ago

I recently found an issue with latest config split version 2.0.0-rc4. Config is not getting exported to split folder when only the current status is active. I have set the default status of my split to inactive and overriding that to active through the settings.php with $config['config_split.config_split.my_split']['status'] = TRUE. When I do drush cex it is only exported the config to default directory and when I tried drush config-split:export it says "Inactive splits can not not be exported". It is taking split as an inactive split even though the current status is active.

  • Create a split name test with a default status as inactive and split some configuration either complete or partial
  • Override the split status to active by having this line $config['config_split.config_split.test']['status'] = TRUE in settings.php
  • Run drush config-split:export and you will find the error saying "Inactive splits can not not be exported"

The error is coming from an if statement which we find in src/ConfigSplitCliService.php
if (!$config->get('status')) {
      $io->warning("Inactive splits can not not be exported.");
      return FALSE;
    }

It seems like $config->get(status) is only considering the default status which needs to be changed. This if statement needs to modified in a way it also needs to check the current status as well.

πŸ› Bug report
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States schirumamilla

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

Comments & Activities

  • Issue created by @schirumamilla
  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    Hi
    Thanks for reporting an issue. Could you please check what the config split overview says?
    It should say what the status is.
    And please make sure you copy the config override example from the split edit form to avoid typos.
    I suspect that the config override doesn't work for some reason.

  • πŸ‡ΊπŸ‡ΈUnited States schirumamilla

    Hi Bircher, thanks for the info. I was able work it out with the example that was provided in the split edit form. May be, the format that I had might be wrong before. I also forgot to mention that I was using the profile_split_enable to override the config initially, then the issue I explained in #1 πŸ› Config is not exported to split folder when only current status is active. Closed: works as designed popped up. I didn't know it was the issue with config_split or the profile_split_enable, to further troubleshoot I overrided the split status in settings.php (wrong format) but it was still taking the config override settings by profile_split_enable since it is a wrong format. I did further debugging and found that the profile_split_enable was using the KernelEvents::REQUEST which is the reason the drush config-split:export is failing. There was a merge request for profile_split_enable which is in RTBC status but it was never merged. This is the issue πŸ› Use config override instead of event subscirber to enable the profile split RTBC page. I was able to apply it as a patch and it started working right away. Do we have any timeline on when that MR could get merged?

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    Hi
    I am glad it worked out for you.
    I do not maintain profile_split_enable so I can not make any prediction about its merge requests.

Production build 0.71.5 2024