giwrgos Posted January 7, 2013 Share Posted January 7, 2013 Hello i have tried to upgrade my prestashop from 1.4.9 to 1.5.3. i have uploaded the site on a different folder to check if is working first. when i upgraded the website i had this error <action result="fail" error="28" /> I've change the settings in order to see the errors and i had this error. Fatal error: Call to undefined method Tools::nl2br() in testfolder/classes/db/Db.php on line 626 how i can fix it? Link to comment Share on other sites More sharing options...
Torbz Posted February 7, 2013 Share Posted February 7, 2013 Ok, you can fix this by doing the following: In the file: /modules/autoupgrade/classes/Tools14.php Put the following code in somewhere with the file that does not break or disturb any other function. * Convert \n and \r\n and \r to <br /> * * @param string $string String to transform * @return string New string */ public static function nl2br($str) { return str_replace(array("\r\n", "\r", "\n"), '<br />', $str); } This is because this little function was missed out of the file. 1 Link to comment Share on other sites More sharing options...
Torbz Posted February 7, 2013 Share Posted February 7, 2013 I slotted this in on line 1933 just after the displayAsDeprecated function...which is also called during the autoupgrade process. It also didn't stop multiple errors from occurring in the database upgrade, which I will look at in a different thread. /** * Display a warning message indicating that the method is deprecated */ public static function displayAsDeprecated() { if (_PS_DISPLAY_COMPATIBILITY_WARNING_) { $backtrace = debug_backtrace(); $callee = next($backtrace); trigger_error('Function <strong>'.$callee['function'].'()</strong> is deprecated in <strong>'.$callee['file'].'</strong> on line <strong>'.$callee['line'].'</strong><br />', E_USER_WARNING); $message = self::displayError('The function').' '.$callee['function'].' ('.self::displayError('Line').' '.$callee['line'].') '.self::displayError('is deprecated and will be removed in the next major version.'); Logger::addLog($message, 3, $callee['class']); } } /** * Convert \n and \r\n and \r to <br /> * * @param string $string String to transform * @return string New string */ public static function nl2br($str) { return str_replace(array("\r\n", "\r", "\n"), '<br />', $str); } 1 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