OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

Fixes missing dependencies in the ShellBlueprint

Open gvkries opened this issue 6 days ago • 1 comments

If a module contains no feature that matches the extension ID, some dependencies like startup classes were not being added to the ShellBlueprint and therefore not executed at all.

This PR fixes that by changing the ExtensionManager to always add every exported type to the features contained in the module. Any type that had no associated feature before, is now added to each feature as a dependency. By doing this, the CompositionStrategy will correctly find all dependencies and all startup classes are executed.

Note that while working on this fix, I found another issue. The order in which startup classes are executed depends on the ExtensionManager.LoadFeaturesAsync() method, which must already return the features in order of dependencies. However, it returns an unordered list that comes from the Dictionary.Values property. I've fixed that as well, which allows us to use another FrozenDictionary as a small tweak as well.

This PR is based on #16324 because this change is in the same area and there is no benefit to fixing before #16324.

Fixes #16375

gvkries avatar Jun 27 '24 11:06 gvkries