Jump to content

Blank Screens After Upgrade to CC528?


bsmither

Recommended Posts

Warning:

 

CubeCart 5.2.8 adds the ability to have Smarty statements in the HomePage Document.

 

If your HomePage Document contains CSS or javascript statements, those statements may be using braces that do not have whitespace next to them. For example:

 

 h2.bold {font-weight:bold;}

 

if (expression) {do_some_function;}

 

Smarty will claim for itself and attempt to parse any content contained in braces that does not have whitespace between the brace and the contents.

 

There are two fixes - choose one:

  • Remove that ability
  • Manually work through the HomePage Document (admin, Documents, any document marked as Homepage) making the changes to the code in Source mode (hopefully, the rich text editor will not try to compress the HTML so that the whitespaces are removed).

In the file /classes/cubecart.class.php, near line 86, find:

'content'    => $GLOBALS['smarty']->fetch('string:'.$home['doc_content'])

Make it look like:

'content'    => $home['doc_content']

 

When you have CubeCart open a document for editing, the Content tab has a rich text editor. The upper-left corner has a "Source" button. Click it.

 

Viewing the raw HTML of the document, work your way through looking for braces -- intentional or not (that is, braces grouping CSS property statements or simply using {braces} in paragraphs). These braces must be fixed.

 

h2.bold {

  font-weight:bold;

}

 

Simply using {literal}{braces}{/literal} in paragraphs.

or

Simply using { braces } in paragraphs.

 

 
Link to comment
Share on other sites

  • 3 weeks later...

My website has crashed due to the issue outlined below. This happened 24 hours ago when I upgraded to 5.2.8 due to the admin console alerting me that I needed to do so. I submitted a support ticket and waited for a response on UK time (I am in Australia). The response when it finally arrived advised me to read this post and follow the instructions to recode my homepage!!! I am not a professional coder and this issue was clearly caused by the CubeCart upgrade. Upgrades should be fully tested before they are released. If support is not to be provided, what can I do now? Should I reinstall the previous back-up and ignore all future upgrades?  I am feeling quite upset about this as I read the above warning too late.

Link to comment
Share on other sites

Maybe during the testing phase of upgrade (or right at the start), the Homepage doc can be examined and if found to contain braces, wrap {literal}{/literal} around the entirety of the doc_content and save. Then throw up a nice, big, fat warning about this new feature, giving a link that takes the admin to the document loaded into the editor.

 

--OR--

 

Also, below the editor, add (in all stock languages) instruction that says, for example:

 

The document's content can contain Smarty markup. This gives programmatic control over the document's content and layout. Please review the Smarty documentation at xyz.

 

Then, and this is important, in the loadDocument function (or displayHomePage), pre-set Smarty's delimiters to something strange, and post-set them back to normal.

Link to comment
Share on other sites

Well I think this kind of functionality is for 5%. Anyone wanting to do this will know what they are wanting to do. As a result maybe all defult to not being parsed by Smarty unless the document is flagged in some way. 

 

Parse this with Smarty: Yes/No (Default)

 

A help link can educate what Smarty is and the benefits. This opens a whole chest of cool features. Say for example you wanted a different homepage content for different visitors based on their customer group or location? 

Link to comment
Share on other sites

 

A help link can educate what Smarty is and the benefits. This opens a whole chest of cool features. Say for example you wanted a different homepage content for different visitors based on their customer group or location?

 

Perhaps a tutorial with examples of what Smarty can do would change that 5% to much higher.

Link to comment
Share on other sites

I've just upgraded to the latest version of Cuebcart and the store was working fine last night, but this morning I have the following error

 

"[Exception] /home/sites/quantumenterprises.co.uk/public_html/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:22 - Syntax error in template "0b34c2761c44d1cb45bc48be860e99ec6b82b53e" on line 22 "Quantum Enterprises, 4 The Old School House, Lower Sea Lane, Charmouth, Dorset, DT6 6LJ. UK | Tel. +44 (0)1823 729 401+44 (0)1823 729 401" - Unexpected ":", expected one of: "}"

 

and blank front end pages. The back end is fine.

 

There are no braces or script code  in the main document and I have tried different skins.

 

Any ideas? I need to get my store back up and running!

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...