Jump to content

Blank front page but back office work fine


Recommended Posts

I am using version 1.5.4.1

 

I am not sure what have i done but my main web page displaying blank but back office work fine.

I turned on the error debug and got the following error:

 

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/home/vncon871/public_html/themes/mimishop/header.tpl" on line 90 "escape:'htmlall':'UTF-8'}" {if" - Unexpected " ", expected one of: "identifier" , "@"' in /home/vncon871/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:665 Stack trace: #0 /home/vncon871/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 /home/vncon871/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(29, '?') #2 /home/vncon871/public_html/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(29, '?') #3 /home/vncon871/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php(200): Smarty_Internal_SmartyTemplateCompiler->doCompi in /home/vncon871/public_html/tools

 

 

 

Can anyone help me?? I don't know much about programming ...

 

thanks!

Link to comment
Share on other sites

Hi,

 

You have modified something on the theme?... because it looks like this is a theme issue. If you will switch to the default one that, the front office it should work. I think you have deleted an if / else statement on header.tpl. If you do have a back-up of header.tpl just roll it back and see what it happens.

Edited by PrestaCoder.com (see edit history)
Link to comment
Share on other sites

  • 5 months later...

Hi,

 

I also have a blank page and I got this answer;

 

Warning: require_once(/var/lib/prestashop/shop.bjarstal.com/override/classes/../../modules/cloudcache/cloudcache.php): failed to open stream: No such file or directory in /var/lib/prestashop/shop.bjarstal.com/override/classes/Tools.php on line 175 Fatal error: require_once(): Failed opening required '/var/lib/prestashop/shop.bjarstal.com/override/classes/../../modules/cloudcache/cloudcache.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/lib/prestashop/shop.bjarstal.com/override/classes/Tools.php on line 175

 

 

What is this??

Link to comment
Share on other sites

I got this answer

 

Warning: require_once(/var/lib/prestashop/shop.bjarstal.com/override/classes/../../modules/cloudcache/cloudcache.php): failed to open stream: No such file or directory in /var/lib/prestashop/shop.bjarstal.com/override/classes/Tools.php on line 175 Fatal error: require_once(): Failed opening required '/var/lib/prestashop/shop.bjarstal.com/override/classes/../../modules/cloudcache/cloudcache.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/lib/prestashop/shop.bjarstal.com/override/classes/Tools.php on line 175

 

 

Anyone can help?

Link to comment
Share on other sites

Hello again,

 

I just run the update again and I the same thing happend, the same message as earlier.

 

Marty; I don't understand what you mean with the cloudcache module. In any case there is no such module installed.

 

 

Mudal; Below you will find the Tools.php

 

<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2013 PrestaShop SA
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

class Tools extends ToolsCore
{
 /** @var _totalServerCount Total count of all servers */
 private static $_totalServerCount = 0;
 /** @var _servers Array containing all the media servers by type */
 private static $_servers = null;
 /** @var _serversCount Array countaining the count of servers by type */
 private static $_serversCount = null;
 /** @var _fileTypes Available file types */
 private static $_fileTypes = null;
 /** @var _activatedModule Flag weither or not the module is active */
 private static $_activatedModule = false;

 public static $id_shop_group = 1;
 public static $id_shop = 1;

 /** @var _isActive Flag to know if the module is active or note */
 public static $_isActive = -1;

 private static function _selectProtocol(&$url)
 {
  $useSSL = (Configuration::get('PS_SSL_ENABLED') && Tools::usingSecureMode());

  if (preg_match('#(.*)\.'.Configuration::get('CLOUDCACHE_API_COMPANY_ID').'\.netdna-cdn.com$#', $url, $matches) && $useSSL)
   $url = $matches[1].'-'.Configuration::get('CLOUDCACHE_API_COMPANY_ID').'.netdna-ssl.com';

 }

 /**
  * @brief Init the statics needed by getMediaServer
  */
 private static function _initServers()
 {
  require_once(dirname(__FILE__).'/../../modules/cloudcache/backward_compatibility/backward.php');

  $context = Context::getContext();
  self::$id_shop = $context->shop->id;
  self::$id_shop_group = $context->shop->id_shop_group;

  // Init the statics
  self::$_servers = array();
  self::$_serversCount = array();
  self::$_fileTypes = array(CLOUDCACHE_FILE_TYPE_IMG, CLOUDCACHE_FILE_TYPE_JS,
            CLOUDCACHE_FILE_TYPE_CSS, CLOUDCACHE_FILE_TYPE_OTHER,
            CLOUDCACHE_FILE_TYPE_ALL);

  // check if the module is active
  self::$_activatedModule = Configuration::get('CLOUDCACHE_API_ACTIVE');

  foreach (self::$_fileTypes as $type)
  {
   self::$_servers[$type] = array();
   self::$_serversCount[$type] = 0;
  }

  $d = Db::getInstance()->executeS('SELECT `cdn_url`, `file_type`
         FROM `'._DB_PREFIX_.'cloudcache_zone`
         WHERE `file_type` != \''.CLOUDCACHE_FILE_TYPE_UNASSOCIATED.'\' AND `id_shop` = '.(int)self::$id_shop);

  $allOnly = false;
  foreach ($d as $line)
   if ($line['file_type'] == CLOUDCACHE_FILE_TYPE_ALL)
   {
    $protocol = self::_selectProtocol($line['cdn_url']); // Must be there because _SelectProtocol updates the url
    self::$_servers[CLOUDCACHE_FILE_TYPE_ALL][] = array('url' => $line['cdn_url'], 'protocol' => $protocol);
    self::$_serversCount[CLOUDCACHE_FILE_TYPE_ALL]++;
    self::$_totalServerCount++;
    $allOnly = true;
   }

  foreach ($d as $line)
   if ($line['file_type'] && !$allOnly)
   {
    $protocol = self::_selectProtocol($line['cdn_url']); // Must be there because _SelectProtocol updates the url
    self::$_servers[$line['file_type']][] = array('url' => $line['cdn_url'], 'protocol' => $protocol);
    self::$_serversCount[$line['file_type']]++;
    self::$_totalServerCount++;
   }
 }

 /**
  * @brief Temper with JS files
  *
  * @param js_uri URI of the JS
  *
  * @note 1.4 only
  */
 public static function addJS($js_uri)
 {
  parent::addJS($js_uri);

  if (!self::_isActive())
   return ;

  global $js_files;

  foreach ($js_files as &$file)
   if (!preg_match('/^http(s?):\/\//i', $file))
   {

    $file = self::getMediaServer($file, $proto).$file;
    $file = $proto.$file;
   }
 }

 /**
  * @brief Temper with CSS files
  *
  * @param css_uri URI of the CSS
  * @param css_media_type Type of the css
  *
  * @note 1.4 only
  */
 public static function addCSS($css_uri, $css_media_type = 'all')
 {
  parent::addCSS($css_uri, $css_media_type);

  if (!self::_isActive())
   return ;

  global $css_files;

  $new = array();
  foreach ($css_files as $key => $file)
  {
   if (!preg_match('/^http(s?):\/\//i', $key))
   {

    $key = self::getMediaServer($key, $proto).$key; // Pass as reference, do not move $proto
    $key = $proto.$key;
   }
   $new[$key] = $file;
  }
  $css_files = $new;
 }

 public static function getProtocol($use_ssl = null)
 {
  if (self::_isActive())

  return parent::getProtocol($use_ssl);
 }

 private static function _isActive()
 {
  if (self::$_isActive == -1)
  {
   // This override is part of the cloudcache module, so the cloudcache.php file exists
   require_once(dirname(__FILE__).'/../../modules/cloudcache/cloudcache.php');
   $module = new CloudCache();
   self::$_isActive = $module->active;
  }

  return self::$_isActive;
 }

 /**
  * @brief Retrieve the media server to use
  *
  * @param filename Name of the file to serve (acually, part of the path)
  *
  * @todo Check performences
  *
  * @return URL of the server to use.
  */
 public static function getMediaServer($filename, &$protocol = NULL)
 {
  if (!self::_isActive())
   return parent::getMediaServer($filename);

  // Init the server list if needed
  if (!self::$_servers)
   self::_initServers();

  if (!self::$_activatedModule)
   return parent::getMediaServer($filename);

  // If there is a least one ALL server, then use one of them
  if (self::$_serversCount[CLOUDCACHE_FILE_TYPE_ALL])
  {
   $server = self::$_servers[CLOUDCACHE_FILE_TYPE_ALL][(abs(crc32($filename)) %
     self::$_serversCount[CLOUDCACHE_FILE_TYPE_ALL])];
   if ($protocol)
    $protocol = $server['protocol'];
   return $server['url'];
  }

  // If there is servers, then use them
  if (self::$_totalServerCount)
  {
   // Loop on the file types to find the current one
   foreach (self::$_fileTypes as $type)
    // If we find the type in the filename, then it is our
    if (strstr($filename, $type) && self::$_serversCount[$type])
    {
     // Return one of those server
     $server = (self::$_servers[$type][(abs(crc32($filename)) %
        self::$_serversCount[$type])]);
     if ($protocol)
      $protocol = $server['protocol'];
     return $server['url'];
    }

   // If no file type found, then it is 'other'
   // If there is server setted for the 'other' type, use it
   if (self::$_serversCount[CLOUDCACHE_FILE_TYPE_OTHER])
   {
    // Return one of the server setted up
    $server = (self::$_servers[$type][(abs(crc32($filename)) %
           self::$_serversCount[$type])]);
    if ($protocol)
     $protocol = $server['protocol'];
    return $server['url'];
   }
  }

  // If there is no server setted up, then use the parent method
  return parent::getMediaServer($filename);
 }
}

Link to comment
Share on other sites

These are the lines 174-178. Odd, because I do not have the module installed. Should I install it? and what is it for?

 

// This override is part of the cloudcache module, so the cloudcache.php file exists
   require_once(dirname(__FILE__).'/../../modules/cloudcache/cloudcache.php');
   $module = new CloudCache();
   self::$_isActive = $module->active;
  }
 

Link to comment
Share on other sites

Hi,

 

I have not touched it. I am not that advanced. This problem turned up with the upgrade to 1.5.6.1 from 1.5.4.something   Now I have upgraded, reinstalled the old verion and uppgraded again and both times the problem appered.

 

What to do now? Shall i install cloudcache from Prestashop? Or change the code? If I install Cloudcache they write it is only up to v1.5.5.0  but I have 1.5.6.1  Could it cause problems?

 

Your help is very much appreachiated.

 

Hans

Link to comment
Share on other sites

To quickly fix this. I suggest you download the cloudcache module and upload it to your server. From the code I can see they are only used in case of using cloud cache media servers. So just go ahead, upload the cloudcache module you don't have to install it. I think as long as you have those files, the code will not break.

  • Like 1
Link to comment
Share on other sites

Hi again,

 

I have figured out what have happened. I cannot remember I have ever installed cloudcache BUT after having a look in my backup of the files done before the upgrade, I found the cloudcache module. So I HAVE installed it once, but it was taken away by 1-Click when upgrading but without 1-Click changing the Tool.php That must be considered to be a bug in 1-Click?

 

Thanks

Link to comment
Share on other sites

I don't think it is a bug but most probably intentional. They must have removed cloudcache since it is not supported in 1.5.6. And the overrides are not part of 1-click upgrade. Infact overrides are supposed to be preserved even after upgrades. So its not a bug in 1-click.

  • Like 1
Link to comment
Share on other sites

  • 10 months later...

debug error 
"Strict Standards: Declaration of Dispatcher::loadRoutes() should be compatible with that of DispatcherCore::loadRoutes() in /home1/cctronic/public_html/override/classes/Dispatcher.php on line 16

Strict Standards: Declaration of FrontController::addCSS() should be compatible with that of FrontControllerCore::addCSS() in/home1/cctronic/public_html/override/classes/controller/FrontController.php on line 131

Warning: require_once(/home1/cctronic/public_html/override/classes/controller/../../../modules/cloudcache/cloudcache.php) [function.require-once]: failed to open stream: No such file or directory in/home1/cctronic/public_html/override/classes/controller/FrontController.php on line 78

Fatal error: require_once() [function.require]: Failed opening required '/home1/cctronic/public_html/override/classes/controller/../../../modules/cloudcache/cloudcache.php' (include_path='/home1/cctronic/public_html/tools/htmlpurifier/standalone:.:/usr/lib64/php:/usr/share/pear') in /home1/cctronic/public_html/override/classes/controller/FrontController.php on line 78"

Link to comment
Share on other sites

  • 2 months later...

Hi i am using prestashop 5.3.6

 

I am having a big issue with my front page. It is blank.

I turned on the error debug and got the following error:

 

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file D:\Hosting\9797820\html/cache/smarty/compile\90\5c\64\wrt548f594451af32.40794191' in D:\Hosting\9797820\html\tools\smarty\sysplugins\smarty_internal_write_file.php:44 Stack trace: #0 D:\Hosting\9797820\html\tools\smarty\sysplugins\smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('D:\Hosting\9797...', '<?php /* Smarty...', Object(Smarty)) #1 D:\Hosting\9797820\html\tools\smarty\sysplugins\smarty_internal_templatebase.php(155): Smarty_Internal_Template->compileTemplateSource() #2 D:\Hosting\9797820\html\classes\module\Module.php(1708): Smarty_Internal_TemplateBase->fetch() #3 D:\Hosting\9797820\html\modules\tmhtmlcontent\tmhtmlcontent.php(355): ModuleCore->display('D:\Hosting\9797...', 'views/templates...') #4 D:\Hosting\9797820\html\classes\Hook.php(473): TmHtmlContent->hookDisplayLeftColumn(Array) #5 D:\Hosting\9797820\html\classes\controller\FrontController.php(430): HookCore::exec('displayLeftColu...') #6 D:\Host in D:\Hosting\9797820\html\tools\smarty\sysplugins\smarty_internal_write_file.php on line 44

 

Can anyone help me with that? I am in big trouble because i never had a backup for my prestashop.

 

Thanks

Link to comment
Share on other sites

Hi i am using prestashop 5.3.6

 

I am having a big issue with my front page. It is blank.

I turned on the error debug and got the following error:

 

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file D:\Hosting\9797820\html/cache/smarty/compile\90\5c\64\wrt548f594451af32.40794191' in D:\Hosting\9797820\html\tools\smarty\sysplugins\smarty_internal_write_file.php:44 Stack trace: #0 D:\Hosting\9797820\html\tools\smarty\sysplugins\smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('D:\Hosting\9797...', '<?php /* Smarty...', Object(Smarty)) #1 D:\Hosting\9797820\html\tools\smarty\sysplugins\smarty_internal_templatebase.php(155): Smarty_Internal_Template->compileTemplateSource() #2 D:\Hosting\9797820\html\classes\module\Module.php(1708): Smarty_Internal_TemplateBase->fetch() #3 D:\Hosting\9797820\html\modules\tmhtmlcontent\tmhtmlcontent.php(355): ModuleCore->display('D:\Hosting\9797...', 'views/templates...') #4 D:\Hosting\9797820\html\classes\Hook.php(473): TmHtmlContent->hookDisplayLeftColumn(Array) #5 D:\Hosting\9797820\html\classes\controller\FrontController.php(430): HookCore::exec('displayLeftColu...') #6 D:\Host in D:\Hosting\9797820\html\tools\smarty\sysplugins\smarty_internal_write_file.php on line 44

 

Can anyone help me with that? I am in big trouble because i never had a backup for my prestashop.

 

Thanks

Link to comment
Share on other sites

  • 1 month later...

Hi.

 

I'm having a similar issue.

 

To cut a long story short, I managed to let my hosting account expire and my website was deleted. When I realised my mistake I settled my hosting and selected the option to restore from a back up.

 

Now my problem is that the back office is working fine, but my front office/website just displays a blank white page. I enabled the error debug and it returned the following message.

 

Fatal error: Smarty error: the $compile_dir '/home6/runleve1/public_html/tools/smarty/compile' does not exist, or is not a directory. in /home6/runleve1/public_html/tools/smarty/Smarty.class.php on line 1095

 

Does anyone know what the problem is or any way to fix this please? Or is my website beyond repair.

 

Thank you very much in advance for any help offered.

Link to comment
Share on other sites

It appears you are missing the following directory on your server /tools/smarty/compile/. Have a look at your server and see if this directory is missing. If it is just create the directory. This should solve your problem. 

 

Marty Shue

Thank you very much for your help. This indeed solved my problem.

 

I really appreciate that, your a life saver :-)

Link to comment
Share on other sites

  • 1 year later...

Notice: Undefined property: stdClass::$smarty in /home1/sworld/public_html/wholesalestationery.in/classes/module/Module.php on line 2330

Fatal error: Call to a member function createTemplate() on a non-object in /home1/sworld/public_html/wholesalestationery.in/classes/module/Module.php on line 2330

Link to comment
Share on other sites

×
×
  • Create New...