Improve ConfigDependencyManager::getDependentEntities() documentation

Created on 13 May 2016, over 8 years ago
Updated 18 November 2024, about 1 month ago

#2080823: Create API to discover config entities' soft dependencies and use this to present a confirm form on module uninstall β†’ added a method getDependentEntities() to \Drupal\Core\Config\Entity\ConfigDependencyManager. The documentation for this method simply says that it "gets dependencies". The implication is that it returns the list of forward dependencies for a given configuration entity. For instance, if I pass it a field instance config, I would expect it to return just the storage config as a dependency. If I pass the field storage config, I would expect it to usually return nothing.

However, the actual behavior seems to be to return the entire dependency tree, including reverse dependencies. In other words, if I pass it a field storage config, I get the field instance config and everything that depends on that config (for instance, views) all the way back up the dependency tree. This is because the method in turn calls createGraphConfigEntityDependencies(), which returns the reverse paths for the dependency graph.

This is problematic because Features relies on this method to return the dependencies for a given config ( #2533844: Use ConfigDependencyManager for determining config dependency β†’ ), but since it's actually returning dependencies and dependent configs, dependencies are erroneously included, causing #2720167: Config dependency detection logic β†’ .

At the least, the documentation for this method needs to be updated to clarify the intended behavior. If the method is behaving as intended, then Features is probably using it incorrectly and needs to find a new method of building dependencies trees. If the method is not behaving as intended, then it needs to be patched.

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component

configuration system

Created by

πŸ‡ΊπŸ‡ΈUnited States dane powell

Live updates comments and jobs are added and updated live.
  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024