Project:Install Profile API
Version:6.x-2.x-dev
Component:CRUD functions and includes
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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.

AttachmentSize
enable_multiple_themes.patch1.07 KB

Comments

#1

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.

AttachmentSize
enable_multiple_themes.v2.patch 1.17 KB

#2

Status:active» needs review

#3

Status:needs review» reviewed & tested by the community

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

#4

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?

#5

Status:reviewed & tested by the community» fixed

Committed to DRUPAL-6--2 branch.

#6

Status:fixed» closed (fixed)

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

#7

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

#8

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.

#9

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

#10

subscribe