Jump to content

LIVE EDIT BUTTON gives me a FATAL ERROR message


Recommended Posts

Hi Guys,

i've to prestashop installed, i'm talking about version 1.4 - When i use LIVE EDIT button to move modules on homepage from left to right or other positions, on one store it works great, on the second stores it gives me a message FATAL ERROR. why? what should i do to make it working?

Thanks

Link to comment
Share on other sites

Hi falabby,

This bug has been fixed on svn.
To fixe it open FrontController.php approximately on ligne 274 juste replace the if condition like this
if (!is_dir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$ad))



Regards



I can't find the code to replace. What exactly should I be looking for? Thanks
Link to comment
Share on other sites

Falaby,

the FrontController.php file is inside the Classes folder
Scroll down to line#274 you will see // live edit just above that..
then two lines begining with "if"

   if (Tools::isSubmit('live_edit') AND $ad = Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_)))
           if (is_dir($_SERVER['DOCUMENT_ROOT'].__PS_BASE_URI__.$ad))
                       $cookie->live_edit = true;



Change the second line:

if (is_dir($_SERVER['DOCUMENT_ROOT'].__PS_BASE_URI__.$ad))
                       $cookie->live_edit = true;



to

   if (!is_dir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$ad)) 
$cookie->live_edit = true;



Looks like it is working now..

Link to comment
Share on other sites

  • 1 year later...

Just upgraded from 1.4.8.3 to 1.4.9.0 and now I have a fatal error when I try to use Live Edit

 

Same here. After upgrade to 1.4.9.

 

But my front controller looks different.

 

//live edit

 

 

if (Tools::isSubmit('live_edit') && $ad = Tools::getValue('ad') && Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))

 

 

{

self::$smarty->assign(array('ad' => $ad, 'live_edit' => true));

self::$smarty->display(_PS_ALL_THEMES_DIR_.'live_edit.tpl');

}

else

Tools::displayError();

}

 

Not sure where to add the code.

Link to comment
Share on other sites

I had the same problem - fatal error.

 

As a temporary measure I tried the Live edit code from FrontController.php in version 1.4.8.2

 

so on line 320 (1.4.9) file I changed line from

 

if (Tools::isSubmit('live_edit') && $ad = Tools::getValue('ad') && Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))

 

to

 

if (Tools::isSubmit('live_edit') AND $ad = Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_)))

 

and it all works ok again

  • Like 3
Link to comment
Share on other sites

Sorry forgot to add line 520 was changed as well to read the same and I also had problems saving the new layout, but changed line

 

452: Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.min.js', _PS_JS_DIR_.'jquery/jquery.easing.1.3.js', _PS_JS_DIR_.'tools.js'));

 

to the older version

 

Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery-1.4.4.min.js', _PS_JS_DIR_.'jquery/jquery.easing.1.3.js', _PS_JS_DIR_.'tools.js'));

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

Sorry forgot to add line 520 was changed as well to read the same and I also had problems saving the new layout, but changed line

 

452: Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.min.js', _PS_JS_DIR_.'jquery/jquery.easing.1.3.js', _PS_JS_DIR_.'tools.js'));

 

to the older version

 

Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery-1.4.4.min.js', _PS_JS_DIR_.'jquery/jquery.easing.1.3.js', _PS_JS_DIR_.'tools.js'));

 

 

 

 

 

Perfect thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

there are 4 files of FrontController.php....what is the root, please?

text-x-generic.png

/public_html/override/classes/_FrontController.php

text-x-generic.png

/public_html/modules/cloudcache/override/classes/controller/FrontController.php

text-x-generic.png

/public_html/modules/cloudcache/override_14/classes/FrontController.php

text-x-generic.png

/public_html/classes/FrontController.php

Edited by Inpromark (see edit history)
Link to comment
Share on other sites

  • 1 month later...

I had the same problem - fatal error.

 

As a temporary measure I tried the Live edit code from FrontController.php in version 1.4.8.2

 

so on line 320 (1.4.9) file I changed line from

 

if (Tools::isSubmit('live_edit') && $ad = Tools::getValue('ad') && Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))

 

to

 

if (Tools::isSubmit('live_edit') AND $ad = Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_)))

 

and it all works ok again

Sorry forgot to add line 520 was changed as well to read the same and I also had problems saving the new layout, but changed line

 

452: Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.min.js', _PS_JS_DIR_.'jquery/jquery.easing.1.3.js', _PS_JS_DIR_.'tools.js'));

 

to the older version

 

Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery-1.4.4.min.js', _PS_JS_DIR_.'jquery/jquery.easing.1.3.js', _PS_JS_DIR_.'tools.js'));

 

Worked for me with Prestashop 1.4.9

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...