[email protected] Posted April 5, 2013 Share Posted April 5, 2013 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][b]DbCore->displayError[/b] - [line 307 - classes/db/Db.php] - [1 Arguments] [b]DbCore->query[/b] - [line 447 - classes/db/Db.php] - [1 Arguments] [b]DbCore->execute[/b] - [line 14 - modules/homeslider/upgrade/install-1.2.1.php] - [1 Arguments] [b]upgrade_module_1_2_1[/b] - [line 346 - classes/module/Module.php] - [1 Arguments] [b]ModuleCore->runUpgradeModule[/b] - [line 1031 - controllers/admin/AdminModulesController.php] - [size=3][0 Argument][/size] [b]AdminModulesControllerCore->initContent[/b] - [line 167 - classes/controller/Controller.php] - [size=3][0 Argument][/size] [b]ControllerCore->run[/b] - [line 349 - classes/Dispatcher.php] - [size=3][0 Argument][/size] [b]DispatcherCore->dispatch[/b] - [line 50 - admin75149/index.php] - [size=3][0 Argument][/size] Link to comment Share on other sites More sharing options...
[email protected] Posted April 5, 2013 Author Share Posted April 5, 2013 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 More sharing options...
[email protected] Posted April 5, 2013 Author Share Posted April 5, 2013 Just deleted the module, since we're not using it really. But I think this is possibly a bug in the upgrade script. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now