Jump to content

Upgrading to 5.2.8


van_the_man

Recommended Posts

Hello,

 

When I visit your site, I get web server headers, but no actual content. And I get the favicon (auto-requested by my browser). I get a PHP session cookie valid for one hour (standard for CubeCart), and the P3P policy string. Therefore, there is enough of CubeCart that is getting woken up properly.

 

I am going to suggest that you get to admin, Maintenance, Rebuild tab, and clear the cache. (You didn't mention if you had already done that.)

 

I also see in the web server headers that (perhaps) your hosting account has a Squid Proxy Server and that when I request the page, the header says MISS from localhost:3128. (I hope that's not my local proxy server in my network.) But I can't say if having upgraded the CubeCart app will cause problems with regard to Squid.

 

I would ask that you find a means of having PHP log errors to a log file. If Smarty (the template rendering engine) complains about a syntax error in a template, the error log may be the only place where you will catch it.

Link to comment
Share on other sites

Hi bsmither!

 

It turns out it was a problem with a facebook activity feed added to the homepage document. I have added the error recorded in the 'System Error Log' tab from the admin site below (for reference):

 

/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:78 - Syntax error in template "967eb914e61cc5853655d3e0f65a0570f93f709a" on line 78 "var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}" - Unexpected ";", expected one of: "}"

 

All sorted now, but nevertheless thanks for your quick response!

Link to comment
Share on other sites

Specifically, Smarty reserves for itself all contents contained within braces without whitespace.

 

So, {return;} will be claimed and parsed by Smarty (and will report a syntax error), while { return; } will be left alone for the javascript to have. The whitespace can be a space, tab, new line, etc.

 

If fixing all the javascript to have whitespace in braces is not practical, Smarty gives you this:

{literal}

Whatever javascript you have;

{/literal}

Link to comment
Share on other sites

As I understand it, van did share the fix that worked for him. He found an error log message that led him to believe it was a set of code he had added to main.php. Then Bsmither offered a way to fix the code, rather than take it off.

 

SO if you are experiencing this, the place to start should be your error logs.

Link to comment
Share on other sites

I don't fully understand the working of smarty/code so I don't understand Bsmitter reply/fix .
 
I get the following error each time I refresh the homepage in the system error log in the admin:-
 
[Exception] /var/www/web/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:6 - Syntax error in template "100b2ac4751acdf412736e8623b59ddb071e6466" on line 6 ".style2 {color: #000000}" - Unexpected ": ", expected one of: "}"
 
I have looked in includeslibsmartysyspluginssmarty_internal_templatecompilerbase.php at line 6 and its a commented out line with the following " * This file contains the basic classes and methodes for compiling Smarty templates with lexer/parser  "
 
I have tried overwriting the contents of the smarty folder includes/lib/smarty/ with the contents of the old 5.2.7 still no joy.
 
This is a upgrade of 5.2.8 over a freah install 5.2.7 no mods code changes have been made.

Link to comment
Share on other sites

Welcome ian_tttt! Glad to see you made it to the forums.

 

Please look in the folder /cache/skin/. In there you find a lot of files with nonsensical names. One will be:

100b2ac4751acdf412736e8623b59ddb071e6466.file.template_name.php

where template_name could be main.php.

 

Using template_name as a clue (for example, main.php), open the actual skin template file for editing (/skins/ACTIVE_SKIN/templates/main.php).

 

Find the statement that has this:

.style2 {color: #000000}

 

As discussed above, Smarty will claim for itself anything in braces without whitespace. The statement above has color: #000000 within braces with no whitespace separating the contents within the braces, and the braces.

 

To fix this, make the statement look like:

.style2 {  color: #000000;  }

 

Notice the space between the opening and closing braces and the contents within the braces.

 

FYI: Yes -- Smarty logs the error, mentioning its own system file that got confused about the bad template. So, this is a case of a bad data file causing a problem elsewhere - a 'red herring' if that means anything to you.

Link to comment
Share on other sites

Thanks bsmither for the link, it must be that that caused the problem as in my home document I do have CSS which I guess what was on the error, I could not find any .style2 in the skin tempaltes/cache

 

In my home page i have CSS:-
.style2 {color: #000000}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style3 {
color: #FFFFFF;
font-weight: bold;
}

 

 

unfortunately I threw the towel in to early last night and reinstalled a fresh 5.2.8 dumping the database (just on a test environment, not live)  but not yet added the homepage code. I will go through the home page code over the weekend adding the white spaces and guess I will only know if it work when I upgrade again.

 

 

thanks for your help time and effort,

Link to comment
Share on other sites

Hmmmm so the new code we added to allow smarty code clearly has issues in some circumstances! Maybe we should remove the parsing or add some clever parsing to escape with "literal" blocks.

 

Im sorry you felt the need to reinstall. Our support staff could have resolved this for you without having to restart although our office is closed over the weekend. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...