Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-529: Include dynamic base theme when GetFeatures is called #33

Merged
merged 4 commits into from
Jan 27, 2023

Conversation

davidpuplava
Copy link
Contributor

@davidpuplava davidpuplava commented Jan 23, 2023

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,

  1. Create a new site with TheBlogRecipe
  2. Enable the MediaTheme feature
  3. Enable Lucene Query Search feature
  4. Set current theme to Media Theme
  5. Go to admin UI Settings, Media Theme, select base theme to be The Blog Theme
  6. Navigate to site's /search URL and observe the header zone is rendered from the Search shape in TheBlogTheme

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.
@wAsnk wAsnk self-requested a review January 23, 2023 11:49
@davidpuplava davidpuplava changed the title Include dynamic base theme when GetFeatures is called OSOCE-529: Include dynamic base theme when GetFeatures is called Jan 23, 2023
@davidpuplava davidpuplava changed the title OSOCE-529: Include dynamic base theme when GetFeatures is called OSOE-529: Include dynamic base theme when GetFeatures is called Jan 23, 2023
@wAsnk wAsnk merged commit 9323043 into Lombiq:dev Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants