Pagestyle module doesn't work properly with the Boost module.

Follow these steps to reproduce the issue:
1. Install drupal 6.17, boost 6.x-1.18, Pagestyle 6.x-1.9, create some pages. Temporarily disable boost (admin/settings/performance/boost)
2. On the admin/settings/pagestyle page in the "Advanced options" check "Support JavaScript"
3. Enable boost
4. Logout
5. Change page style clicking, for instance, on the "yellow_blue" style button.
6. View some pages
7. Open another browser and try to view the site. It will be in yellow-blue colors.

The reason why this happens is that the pagestyle module (file pagestyle.module, string 333) adds javascript through drupal_add_js function which is cached by boost module. The boost module caches the entire page and when other visitors open cached pages the variable var pagestyleCurrent is already set to "yellow_blue" (look at the HTML code of the page).

To overcome this problem I edited the string number 333 (pagestyle.module):

var pagestyleCurrent;', 'inline');

and created js file with the following content:

$(document).ready(function(){
	var pagestyle = 'standard';

	if ($.cookie("pagestyle"))
		pagestyle = $.cookie("pagestyle");

	var pagestyleCurrent = pagestyle;
});

The same issue is with the textsize module.

Comments

CZ’s picture

Hi CraZy_DeveLopeR

Thanks for your report. Then we have no PHP check about the content of the Page Style Cookie. So I can edit the cookie local, and the modul will be unusable. A JavaScript check can not be save. So we have to search for a solution.

RedTop’s picture

I just found this module and it does exactly what I'm looking for. This issue would prevent me from using the module...

How about if we disable Boost javascript caching until another solution is found. Would that make a difference?

RedTop’s picture

Another way would be to configure Boost settings to only cache pages for which a PHP snippit returns true... Boost offers that handy option. I'm just not a PHP coder. :(

The reverse is happening as well btw... once a page has been cached in 'normal style' one has to set the high contrast style on each and every page.

CZ’s picture

Possible. But not standard(?). Let's see what I can do.

CZ’s picture

Status: Active » Fixed

Thanks. Should be fixed.

Status: Fixed » Closed (fixed)

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