OSOE-529: Include dynamic base theme when GetFeatures is called #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently MediaTheme's ExtensionManagerDecorator decorates the registered IExtensionManager type to include it's dynamically selected base theme as a MediaTheme dependency.
This works everywhere in OrchardCore (OC) where IExtensionManager is used with depencency injection (DI).
But, the default implementation ExtensionManager internally calls GetFeatureDependencies() without DI bypassing MediaTheme's decoration for including the base theme as a dependency.
Fixes repo issue #30, JIRA issue OSOE-529
I spent time looking deep into Orchard Core to see if I could find a more elegant solution but I have a bit more to learn before I do that. Specifically, I think the ThemeBuilderEvents and ThemeExtensionDependencyStrategy extend ExtensionManager through the FeaturesProvider type. I briefly tried to go down that path but gave up once I learned how explicitly setting the BaseTheme in the Manifest.cs file worked.
To test,