install_enable_theme() calls system_theme_data() which rewrites the theme records in the system table; if you want to enable multiple themes, only the last one gets enabled.

Comments

James Andres’s picture

StatusFileSize
new1.17 KB

This patch didn't work for me because I was calling install_default_theme() after install_enable_theme(). I have re-rolled the patch to make this behaviour work as expected.

There is one caveat to this, I had to remove the install_default_theme() call in install_default_theme(). Which alters the API behaviour.

Can people let me know if this breakage is acceptable? Hopefully it is okay, because I think this feature is very helpful.

James Andres’s picture

Status: Active » Needs review
psynaptic’s picture

Status: Needs review » Reviewed & tested by the community

I've just tested this patch with success. Works perfectly.

hadsie’s picture

The patch in #1 works for me as well. It makes sense that the default theme should also be enabled though, so I wonder if perhaps there should be other code in place to ensure that when the default is set, it's also verified to be enabled?

James Andres’s picture

Status: Reviewed & tested by the community » Fixed

Committed to DRUPAL-6--2 branch.

Status: Fixed » Closed (fixed)

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

muhleder’s picture

Status: Closed (fixed) » Active

Hmmm.. sorry to reopen but I'm still seeing this behaviour. Themes enabled by install_enable_theme don't actually get enabled, only install_default_theme enables a theme (in fact sets it as the default, but is not set as enabled).

The problem for me seems to be that _system_theme_data() uses a static variable and so the second (or later) time it is called, the original database query is returned rather than the current state.

Bug report relating to this behaviour in the Drupal issue queue here
http://drupal.org/node/632080

James Andres’s picture

Just to be sure, you're using a CVS checkout of the DRUPAL-6--2 branch right? The current release 6.x-2.1 is quite out of date and does not include this fix.

muhleder’s picture

Hi James,

I didn't, but have just updated and tested to a CVS checkout of install_profile_api-DRUPAL-6--2 which does have the code from the patch, and still seeing the behaviour.

To me it looks as if whenever system_theme_data() is called it will reset the enabled themes in the system table to whatever they were on the first pass.

Mark

jarune’s picture

subscribe