Problem/Motivation

Currently, in general, we want to enforce dependencies. That is good but some configurations are way to complicated to remove because of a minor failed dependency. especially when there is a fallback for when dependencies are not met. This has come into play on #2468045: When deleting a content type field, users do not realize the related View also is deleted because when a view depends on a field and that field is removed, the view is removed. #2442757: Move the field storage deletion if the last field has been removed to the UI layer proposes to bring the field storage dependency management to the UI layer which is a good first step. If the site builder is not moving too fast, and notices they are about to remove a view, they can go update the view before removing the field.

But there is allot of configuration in a view (As with other types of configuration). Remove an entire view because a field removal when there is a fallback field (or other) handler is overkill. Contrib configuration will inevitably become complex as well. When a contrib module defines a fallback for unmet configuration dependencies, that dependency should be considered a soft dependency.

Configuration that depends on content is another example of configuration that might need to be considered a soft dependency.

Proposed resolution

Introduce a "Soft" dependency flag.
Provide warnings but not enforcement for configuration dependencies that are flagged as "Soft" when a dependency is about to be broken.

Remaining tasks

Discuss approach and apply.

User interface changes

Adds additional warning to the UI when a dependency is gong to be broken.

API changes

Adds a "Soft" flag to a dependency.

Data model changes

None.

Comments

Jaesin created an issue. See original summary.

er.manojsharma’s picture

@Jaesin did we finalize the approach to complete this task?

er.manojsharma’s picture

Assigned: Unassigned » er.manojsharma
Jaesin’s picture

Assigned: er.manojsharma » Unassigned
swentel’s picture

Path module has similar 'funny' problem: uninstall the path module and all entity form displays will be removed. Kind of annoying :)
However, I'm not in favor of a 'soft' dependency flag if it means that a configuration object would still have a reference to another object that doesn't exist anymore.

I'd rather see different approach which we already have in core which is used when we're deleting fields. Go to any manage fields screen, click on delete and you're informed which config entities are going to be updated (usually form and view displays). What happens is that in those config entities the reference to that field is going to be removed. Way more cleaner that a) deleting (for sure) or b) leave a reference, but then having to implement/show this in the UI and having to account for it as well during rendering/requests etc.

dawehner’s picture

Yeah this kind of change though kinda needs to be solved on a case by case.
For everything which is just rendered it is indeed IMHO the right solution to just not show it anymore. For views filters, this might be different. You now potentially show much more
content than you previously configured to.

Anonymous’s picture

FWIW, i like swentel's idea in #5.

perhaps we can have a global policy which is one of:

1. 'never alter a dependent object, just fail'
2. 'delete the references only in the dependent object'
3. 'delete the dependent object'

dawehner suggested we could also apply that per-type.

catch’s picture

Title: Introduce concept of 'Soft" dependencies. » Formalize patterns for delete/uninstall of configuration dependencies
Category: Task » Plan
Issue tags: +Needs issue summary update

In general #1 we treat as 'don't allow uninstall/delete'.

I agree those three are the right approaches, and we should not have soft configuration dependencies as such since it's impossible for a module to manage it's own stuff when it's not there in terms of update hooks etc.

Some cases we'll want to just choose one (for example not allowing content entity delete, since we can't do bulk deletes safely in core yet), others we might want to allow a choice, this is where we currently have bugs in core and the patterns aren't really defined properly.

Re-titling and moving to a plan for now.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.