Skip to content

Commit

Permalink
Fix to properly pass the theme name to onEnabled-plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
datakurre committed Mar 31, 2015
1 parent 1ed8a8b commit f80b434
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/plone/app/theming/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def findContext(request):
context = getattr(published, '__parent__', None)
if context is not None:
return context

for parent in request.PARENTS:
if IContentish.providedBy(parent) or ISiteRoot.providedBy(parent):
return parent
Expand Down Expand Up @@ -500,15 +500,17 @@ def applyTheme(theme):
plugin.onDisabled(currentTheme, pluginSettings[name],
pluginSettings)

currentTheme = settings.currentTheme
themeDirectory = queryResourceDirectory(
THEME_RESOURCE_NAME, settings.currentTheme)
THEME_RESOURCE_NAME, currentTheme)
if themeDirectory is not None:
plugins = getPlugins()
pluginSettings = getPluginSettings(themeDirectory, plugins)

if pluginSettings is not None:
for name, plugin in plugins:
plugin.onEnabled(theme, pluginSettings[name], pluginSettings)
plugin.onEnabled(currentTheme, pluginSettings[name],
pluginSettings)


def createThemeFromTemplate(title, description, baseOn='template'):
Expand Down

0 comments on commit f80b434

Please sign in to comment.