After running update.php, the skinr configuration for all blocks in my installation disappears.

I did a bit of digging and found that my theme is not being added to the output of skinr_implements_api(), which is called after Drupal's cache is cleared from within update.php. The incorrect return value is then cached, resulting in a disappearance of theme-introduced skinr styles until the site's cache is manually cleared. It appears that list_themes() returns a list of themes where the current theme is not set to active when invoked in this scope. While this reflects a potential issue in core, a workaround within skinr would be valuable.

I found that the following steps reliably reproduce the problem on my local installation:

  • Go to /update.php.
  • Attempt to run database updates (no queued updated necessary).
  • View any page where skinr styles defined by the theming layer are active.

I have temporarily solved this problem within the theming layer by checking to see if skinr recognizes it, and if not, reseting skinr's cache (see below).

if (module_exists('skinr')){
	$skin_info = skinr_get_skin_info();
	if (empty($skin_info)){
		skinr_cache_reset();
	}
}

This solution works, but feels like a hack. I'd like to write a patch to fix this, but I'm not quite sure where to begin - can one of the designers of this module suggest an optimal approach to fix?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moonray’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Issue summary: View changes
moonray’s picture

Priority: Normal » Major
Status: Active » Needs review
FileSize
613 bytes

The correct fix is in this patch. I'm trying to figure out if there is a way to test against this before committing it.

moonray’s picture

The same patch, but with tests.

  • Commit b5921e9 on 7.x-2.x by moonray:
    Issue #2059029 by moonray | uncommented: Fixed Skinr skins defined in...
moonray’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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