Problem/Motivation

All configurations from theme's .info file are getting read and saved in a persistent variable. After that any change to the .info have no effect.

Proposed resolution

Do not store theme's styleswitcher info anywhere.

Data model changes

Persistent variable styleswitcher_styles has been removed.
Instead styleswitcher_custom_styles variable will hold properties of only custom styles (added from admin config form).

API changes

Function styleswitcher_styles_properties() has been removed.
Instead styleswitcher_custom_styles() function has been added to get properties of custom styles.
Function _styleswitcher_get_styles() has been renamed to styleswitcher_theme_styles() and now returns only theme's styles.

Remaining tasks

Add caching of result of styleswitcher_theme_styles() function to not parse theme.info on every page request.
Refresh the cache together with theme's info.

Original issue

by @b3nji:

I created a default style called 'light.css'. Subsequently, I made changes to this style, renamed it 'light2.css' and edited the theme.info file where appropriate (styleswitcher[css][light] = css/light2.css). All caches were flushed. However, when I navigate the site, the browser is still showing the original light.css file...

Comments

pingwin4eg’s picture

Moved a cause to issue summary.

To workaround this issue delete the styleswitcher_styles persistent variable from database and flush Drupal caches. It is almost the same as to uninstall the module and install it again.

pingwin4eg’s picture

Assigned: Unassigned » pingwin4eg
pingwin4eg’s picture

Title: Force new cookie when updating styles » Changes in theme.info not reflected in styles list
Category: Support request » Plan
Issue summary: View changes
Priority: Normal » Major
Issue tags: +beta blocker
pingwin4eg’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new6.29 KB

No caching for now.
The patch applies after #2536504-1: Default style weight.

P.S.: it is anyway needed to clear theme registry cache for changes of theme.info to take effect.

pingwin4eg’s picture

Category: Plan » Bug report
Issue summary: View changes
StatusFileSize
new6.29 KB

Slightly changed names of vars and funcs.
Changed issue category as it is actually a bug.

  • pingwin4eg committed 730088c on 7.x-2.x
    Issue #2449195 by pingwin4eg: Changes in theme.info not reflected in...
pingwin4eg’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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