mikaelthomas Posted October 9, 2012 Share Posted October 9, 2012 Bonjour à tous, J'ai enfin réussis à effectuer la mise à jour de mon prestashop 1.4.9 vers 1.5.1. Franchement très grosse galère, module one-click upgrade impossible à installer, erreur en upgrade manuel avec des codes erreurs non repetoriés (obligé de farfouiller dans les fichiers d'upgrade pour comprendre l'erreur)... Enfin bref, ce n'est vraiment pas une réussite ! Désormais ca fonctionne bien, j'ai réussit à corriger les différentes mais il m'en reste une que je n 'arrive pas à corriger. Lorsque j'active l'affichage des erreurs j'ai cette erreur qui apparait sur chaque image > Notice: Undefined variable: not_default in /var/****/store/classes/Link.php on line 360 http://www.***/store/124-788-home/ecran-complet-iphone-4s-noir.jpg Quelqu'un saurait d'où cela peut venir ? Et aurais une solution (à part schinter cette partie du code ^^) Link to comment Share on other sites More sharing options...
TWFree Posted October 11, 2012 Share Posted October 11, 2012 I had the same problem. This hack seems to fix the problem (temporarily) and get images working again. http://pastebin.com/3A16mCsm classes/Link.php - line 352 A proper fix is needed asap. Link to comment Share on other sites More sharing options...
ctalpaert Posted October 11, 2012 Share Posted October 11, 2012 (edited) Thanks for this fix ^^ But I think is better to do this: File classes/Link.php line 356 for initialize $not_default, I moved up $not_default = strpos($ids, 'default') !== false; from the if condition public function getImageLink($name, $ids, $type = null) { // legacy mode or default image $theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : ''); $not_default = strpos($ids, 'default') !== false; if ((Configuration::get('PS_LEGACY_IMAGES') && (file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg'))) || ($not_default)) { if ($this->allow == 1 && !$not_default) $uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg'; else $uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg'; } else { // if ids if of the form id_product-id_image, we want to extract the id_image part $split_ids = explode('-', $ids); $id_image = (isset($split_ids[1]) ? $split_ids[1] : $split_ids[0]); $theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : ''); if ($this->allow == 1) $uri_path = __PS_BASE_URI__.$id_image.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg'; else $uri_path = _THEME_PROD_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').$theme.'.jpg'; } return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path; } Edited October 11, 2012 by ctalpaert (see edit history) 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