Since the css file is built using a theme function, if a theme does in fact override that template, the override isn't detected when an admin theme is set and the caches are cleared from within the admin section (this happens whenever a menu item is added) because at that point, the default theme isn't active.

I haven't thought of any obvious solutions to this, although one idea was to generate a separate css file for each theme (eg, menu-icons-THEME.css), and then alter hook_init to check if the css file exists, and if not, generate it then.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhedstrom’s picture

Status: Active » Needs review
FileSize
2.14 KB

The attached patch changes the behavior of this module a bit, but works very nicely with admin themes, or sites that are switching themes.

Instead of generating the CSS file when the caches are cleared, the cache clearing removes the old css cache files. Then, hook_init will generate the new css files on a per-theme basis when hook init is called an the appropriate css file for the theme in use doesn't exist.

jhedstrom’s picture

FileSize
2.37 KB

The above patch was missing some logic in the menu submit handler to properly clear out the css cache. This patch fixes that.