Jump to content

Error on Prestashop 1.5.4 when visiting Modules


Recommended Posts

When I go to the Modules page on Prestashop 1.5.4 (which we recently upgraded), I'm getting the following error posted below. Why is this happening?

 

 

[PrestaShopDatabaseException]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\''), '\"', '"'), '\\', '\'), `description` = replace(replace(replace(`descrip' at line 2

UPDATE ps_homeslider_slides_lang SET

`title` = replace(replace(replace(`title`, '\\'', '\''), '\"', '"'), '\\', '\'),

`description` = replace(replace(replace(`description`, '\\'', '\''), '\"', '"'), '\\', '\'),

`legend` = replace(replace(replace(`legend`, '\\'', '\''), '\"', '"'), '\\', '\'),

`url` = replace(replace(replace(`url`, '\\'', '\''), '\"', '"'), '\\', '\')

 

at line 607 in file classes/db/Db.php

 

601. WebserviceRequest::getInstance()->setError(500, '

 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);

602. }

603. else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))

604. {

605. if ($sql)

[color=#F20000][b]606. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');

[/b][/color]607. throw new PrestaShopDatabaseException($this->getMsgError());

608. }

609. }

610.

611. /**

[/font][/color]

Link to comment
Share on other sites

The SQL gets built in modules/homeslider/upgrade/upgrade_module_1_2_1.php:

 

 

<?php

 

if (!defined('_PS_VERSION_'))

exit;

 

function upgrade_module_1_2_1($object)

{

Db::getInstance()->execute('

UPDATE '._DB_PREFIX_.'homeslider_slides_lang SET

'.homeslider_stripslashes_field('title').',

'.homeslider_stripslashes_field('description').',

'.homeslider_stripslashes_field('legend').',

'.homeslider_stripslashes_field('url')

);

}

 

function homeslider_stripslashes_field($field)

{

$quotes = array('\'\\\\\'\'', '\'\\\'\'');

$dquotes = array('\'\\"\'', '\'"\'');

$backslashes = array('\'\\\\\'', '\'\\\'');

 

return '`'.bqSQL($field).'` = replace(replace(replace(`'.bqSQL($field).'`, '.$quotes[0].', '.$quotes[1].'), '.$dquotes[0].', '.$dquotes[1].'), '.$backslashes[0].', '.$backslashes[1].')';

}

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