Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Scenario:
- Admin is editing an existing feature.
- New configuration is assigned by the assignment plugins.
- Admin doesn't want that configuration to be packaged, so unchecks it and regenerates the feature.
- Admin brings the feature up again for editing. Expected result: the removed items are not automatically assigned. Actual result: there they are again.
Relevant code section:
// Save which dependencies are specifically excluded from
// auto-detection.
if (($section == 'detected') && ($default_value === FALSE)) {
// If this was previously required, we don't need to set it as
// excluded because it wasn't automatically assigned.
if (isset($this->required[$component][$key])) {
unset($this->required[$component][$key]);
}
else {
$this->excluded[$component][$key] = $key;
}
// Remove excluded item from export.
if ($component == 'dependencies') {
unset($export['dependencies'][$key]);
}
else {
unset($export['config'][$config_name]);
}
}
There is a parallel section for handling the 'required' constraint. The problem may be that these assignments are handled in the form generation code. So this bug may be solved by #2597850: Constraints (excluded and required) should be added when modifying a feature through Drush.
Comments
Comment #2
nedjoPending #2597850: Constraints (excluded and required) should be added when modifying a feature through Drush, which may resolve this bug.