Problem with J1.7 plugin cache and utf-8 characters.

July 08 Joomla Templates
GK User
Tue Oct 04, 2011 9:00 pm
Hello! I am developing an intranet site in beta, using the template gk_gamebox, everything works perfect until active cache plugin joomla 1.7.

The strange thing is that while the user is logged in, no problems, but when the user is offline or a guest, you are special characters with errors (accents like á, é, ñ, etc ...). I figured it was a coding error, edit the file .htaccess and check the <meta>, even add in javascript, but still the same error when activating the joomla cache.

Now, to rule out that this is not a server configuration error, I tried a default template of joomla as "beez5" and not have the same error, the cache works well both for the user logged in as a visitor.

Help, please! :(
Greetings. :)
User avatar
Fresh Boarder

GK User
Fri Oct 28, 2011 6:28 pm
I have the same problem. Turning cache on, for guests the site is ruined. When logged in everything works fine! Very weird...
User avatar
Fresh Boarder

GK User
Tue Nov 01, 2011 6:05 am
I have the same problem with world news temp.
User avatar
Fresh Boarder

GK User
Tue Nov 01, 2011 9:35 pm
Problem is:
.gkWrap { width: 1000px!important; }
The value joomla core cache disabled

Enable cache a vistor has these values what causes the problem
#gkRight { width: 28%; }
#gkContent { width: 72%; }
.gkWrap { width: 1000px!important; }

Logged you only have this value:
.gkWrap { width: 1000px!important; }

Quick fix:
Overrule in layout.css even better to do this in override.css
#gkContentMainbody { width: 100%!important;margin-bottom: 8px!important; }

This solved the problem but it's not how it supossed to be fixed.
But for it let the cache function working again without distroying the template.

Only on the frontpage still the problem exists in the mainbody area!
User avatar
Fresh Boarder

GK User
Wed Nov 02, 2011 10:16 am
Sorry bug returned, had to switch off cache again :-(
User avatar
Fresh Boarder

GK User
Wed Nov 02, 2011 10:37 am
Just tried this out and i cannot see such behaviour , does anyone have any live link for us to see.

Also you have to enable GK Cache plugin if you are using joomla cache....
User avatar
Platinum Boarder

GK User
Wed Nov 02, 2011 12:26 pm
Finally, finish by consulting a web developer and discovered the error. The problem is that the host sends a non UTF8 encoding and cache, to compile the js and heads, unifies the characterization of the site that sends the php.ini.

Solution provided by an Argentine developer (after months and months of searching the web) is as follows (applies to all Gavick templates)

Open the system cache plugin (with some editor like notepad++), and add the following line at the beginning:

Code: Select all
mb_http_output( "UTF-8" );
header( "Content-Type: text/html; charset=".mb_http_output());


And problem solved, the first thing cache loading is to take that and apply it to coding everything stored. The solution to more complex problems is usually the simplest.

Credits: [email protected]

Greetings!
User avatar
Fresh Boarder

GK User
Wed Nov 02, 2011 5:54 pm
It's a pity, problem still exists when caching is enabled.

@NormanUK see this link:
http://www.maitrepaulpoule.nl/j17/2011- ... em-ii.html

Viewing as guest the contentpage is 72 % width.
When you login, you see the page 100% width.

Disable systemcache and the page is displaying 100% width for guests.

I can give login details if you like to take a look.
User avatar
Fresh Boarder

GK User
Wed Nov 02, 2011 9:01 pm
Wil, can you check your layout settings in template manager and let me know if left column or right column is set to 28% as your main content css class which is "#gkContent" is set to 72% if cache is enabled and user is guest.

if it is change it to another number to test this theory example change it to 30% and see if #gkContent width becomes 70%. This is all without login in as a guest user and cache enabled.

If it does this then the problem is in "templatesgk_twn2libgk.framework.php" where it calculates column layouts and calculates content width on the fly. So it is not a set css and once this is cached on cache retrieval it is not calculating again properly.

Tough why it only happens when user is guest user that is another story...

Anyway try it and let me know...
User avatar
Platinum Boarder

GK User
Thu Nov 03, 2011 1:10 pm
Norman,
The calculating works fine. Changed the value to 30% right, gk#content gives then 70%. But on a pageview as visitor the page loads 70% width. It must be 100%, so you don't want the gk#content picks up a value.
I outcomment all the lines (//$this->addCSSRule('#gkContent) in "templatesgk_twn2libgk.framework.php". (line: 528,531,534). It is not the correct way to fix it but it solved the problem. For now the class #gkContent is not loaded in the headtags, only #gkRight.
The page is now 100% width for visitors and guests!
User avatar
Fresh Boarder

GK User
Thu Nov 03, 2011 1:26 pm
So then that part of the code when cached and retrieved, somewhere in process something gets massed up... I ll try post this in bug report see what admins say...
User avatar
Platinum Boarder

GK User
Thu Nov 03, 2011 1:50 pm
These are the changes, the last line must not be outcomment because that will break the frontpage in where the rightcolumn is active with content. In my case I don't have anything published in het rightcolumn viewing contentpages!
// all columns
$left_column = $this->modules('left_top + left_bottom + left_left + left_right');
$right_column = $this->modules('right_top + right_bottom + right_left + right_right');

if($left_column && $right_column) {
$this->addCSSRule('#gkLeft { width: ' . $this->getParam('left_column_width', '20'). '%; }');
$this->addCSSRule('#gkRight { width: ' . $this->getParam('right_column_width', '20'). '%; }');
//$this->addCSSRule('#gkContent { width: ' . (100 - ($this->getParam('left_column_width', '20') + $this->getParam('right_column_width', '20'))) . '%; }');
} elseif ( $left_column ) {
$this->addCSSRule('#gkLeft { width: ' . $this->getParam('left_column_width', '20'). '%; }');
//$this->addCSSRule('#gkContent { width: ' . (100 - $this->getParam('left_column_width', '20')) . '%; }');
} elseif ( $right_column ) {
$this->addCSSRule('#gkRight { width: ' . $this->getParam('right_column_width', '20'). '%; }');
$this->addCSSRule('#gkContent { width: ' . (100 - $this->getParam('right_column_width', '20')) . '%; }');
}
}
User avatar
Fresh Boarder

GK User
Thu Nov 03, 2011 10:17 pm
Yes that was the code i ve checked as well, and in joomla cache plugin i can see the code for guest users but disabling that to fix the problem is not the right way i believe.
User avatar
Platinum Boarder

GK User
Thu Dec 29, 2011 6:44 am
I am having nearly the same exact issue with J1 1.7 and Gavick Boutique template.
Basically with system cache enabled (and gk_cache enabled and loaded first) there are issues with the module widths.

Originally the issue on my site (www.design3.com) was with the gkContent width %. I tried @AntonellaCu solution which did seem to fix this, however it also messed with some of the CSS on the site, adding bullets in ul elements, etc.. I removed the code from cache.php, cleared the cache and miraculously the gkContent is acting appropriately -- however -- now it is #gkHeader1 that is doing the same thing! (caching the width of some pages and applying it to all).

The issue can be viewed by visiting http://www.design3.com/government
You'll see that the top banner1 position image is truncated to 70% width (which is how it is set in template parameters and displayed on homepage banner).

The other thing that I didn't realize until reading this thread is that it DOES act properly once logged in as Will mentions.

If you create a free account and visit the same link above the header image will properly span 100% page width again... odd.

I assume this is a bug in gk_cache. Very interested in a solution as our servers are getting overloaded with processes and we need to be able to cache properly.

Thanks!
Case
User avatar
Junior Boarder

GK User
Thu Dec 29, 2011 6:50 am
UPDATE: Other layout IDs are still having this issue (not properly caching correct width %'s and/or not properly recalculating width %'s while cache enabled).

See page:
http://www.design3.com/training-center

#gkComponentWrap should be 100% on this page but is cached at 75% even though 25% inset2 module is not active on this page.

If others are also experiencing this problem please respond so we can get some Gavick resources on this.

Thanks,
Case
User avatar
Junior Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.