Jump to content

[Resolved] Blank page on my admin pages


Wolfie2244

Recommended Posts

My partner was trying to create a Facebook Like button on some of our category pages. The Java that Facebook wants you to use wouldn't work, so she followed the Facebook suggestions to get this to work in HTML. But when she pasted some java code, it has stopped us accessing anything in the admin part of the website. Just a blank screen. The shop front still works fine. 

 

I ran a error log and attached the report. 

 

Please help

2015-Oct-Week5-2.log

Link to comment
Share on other sites

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

There is almost no common skin template code between a storefront skin and the admin skin. So, the problem may be somewhere else.

The attached log file is your site's "access" log, which contains no useful information regarding problems your web server is having, or, more importantly, problems PHP is having.

Please create a file called 'ini-custom.inc.php', and have as its contents:

<?php
# Custom initialization commands
# Filename: ini-custom.inc.php
# File location: main CubeCart folder

ini_set('memory_limit', '256M');
ini_set('max_execution_time', '60');
ini_set('error_log', 'error_log');
ini_set('log_errors', 'on');

?>

Place this file in CubeCart's main folder. When you get a blank page, you may now find a file named 'error_log' in the main CubeCart folder.

Let us know what gets logged here.

When adding javascript code or CSS rules to a skin template (storefront or admin), make sure to follow this rule:

Braces must be surrounded by whitespace.

Javascript:
BAD==
var smith = [{simple:'good'}];

GOOD==
var smith = [
             {
               simple:'good'
             }
            ];

CSS:
BAD==
<style>
#section_homepage{color:green};
</style>

GOOD==
<style>
#section_homepage {
    color: green;
}
</style>

The reason is that the template rendering engine (Smarty) uses braces to delineate its variables and commands. To have what is not something Smarty can parse will throw an error and exit PHP - with a blank screen as a result.

{if condition}
  {$var1}
{else}
  {$var2}
{/if}

Smarty's brace delimiters must NOT have whitespace inside the braces.

Link to comment
Share on other sites

Ok. Let's look at the snippet at:
/includes/extra/snippet_2fe67f65b7e3c2361beb5bb454a46cde.php on line 2

I'm not sure if you caught my edits to the post above. Please re-read it.

Fix the code in the snippet which should let you get back in to admin. Then, fix the snippet code in the Snippet Editor.

The snippet code is databased. If CubeCart does not already see the snippet file, it will be created.

 

Link to comment
Share on other sites

Please be aware that code snippets are to change the functionality of CubeCart's internal codebase. Please do not use code snippets to try to add content to the HTML output sent to the browser (although, there is a way to do that).

CubeCart is trying to execute this javascript as if it were PHP code.

There is a better way to add javascript to the web page sent to the browser.

For now, in the list of snippets, delete that snippet.

If you still can't get into admin, edit this snippet file by removing all content from the file except for the first and last line:

<?php

?>

The snippet will still be read in, but there will be nothing to crash PHP.

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