Problem/Motivation

Almost every implementation of Configuration::alterDependecies() contains something like this

if (empty($stack[$identifier])) {
  // Include dependencies here
  $stack[$newDependency->getUniqueId()] = $newDependency;
}

This introduces an interesting issue. In certain cases, a configuration can be created, but don't include all the required dependencies for a certain configuration.

For example, in text formats, two different Configurations could required a certain permission. Like a wysiwyg and a permission. If the wysiwyg creates the text format, the permission will not include the text format as its dependency. And therefore, the permission will always appear as overridden.

Proposed resolution

Modify all the occurrences of Configuration::alterDependencies() to re-use the configuration created in a cache of configurations (that doesn't exists yet). If the stack contains an object, modify that object with the new dependency.

Comments

dagmar’s picture

Status: Active » Needs review
StatusFileSize
new15.59 KB
dagmar’s picture

StatusFileSize
new22.28 KB

Some clean-up.

Status: Needs review » Needs work

The last submitted patch, 1908048.config-dependencies.2.patch, failed testing.

dagmar’s picture

Status: Needs work » Needs review
StatusFileSize
new22.34 KB
dagmar’s picture

Status: Needs review » Fixed

Committed & Pushed to 7.x-2.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.