Amaltheus Posted 17 hours ago Share Posted 17 hours ago Bonjour, J'ai mes hébergements chez O2Switch. Depuis hier bug sur 3 sites en même temps, impossible d'accéder aux backoffices et aux frontoffices. Simple pages blanches sur FireFox, et pages blanches + message http erreur 500 sur chrome. En mode Debug j'ai l'erreur équivalente sur les 3 sites. Exemple c-dessous : Fatal error: Uncaught Error: Call to undefined function PrestaShop\PrestaShop\Core\Addon\Theme\json_decode() in /home/amaltheus/pierres-polies.fr/src/Core/Addon/Theme/ThemeRepository.php:169 Stack trace: #0 /home/amaltheus/pierres-polies.fr/src/Core/Addon/Theme/ThemeRepository.php(83): PrestaShop\PrestaShop\Core\Addon\Theme\ThemeRepository->getConfigFromFile('/home/amaltheus...') #1 /home/amaltheus/pierres-polies.fr/classes/shop/Shop.php(495): PrestaShop\PrestaShop\Core\Addon\Theme\ThemeRepository->getInstanceByName('classic') #2 /home/amaltheus/pierres-polies.fr/classes/shop/Shop.php(137): ShopCore->setTheme() #3 /home/amaltheus/pierres-polies.fr/classes/shop/Shop.php(415): ShopCore->__construct('1') #4 /home/amaltheus/pierres-polies.fr/config/config.inc.php(128): ShopCore::initialize() #5 /home/amaltheus/pierres-polies.fr/admin175wzk9jw/index.php(46): require('/home/amaltheus...') #6 {main} thrown in /home/amaltheus/pierres-polies.fr/src/Core/Addon/Theme/ThemeRepository.php on line 169 Je n'ai pas du tout modifié et travaillé sur mes sites depuis plusieurs jours, le problème est arrivé d'un seul coup sur les 3 sites en même temps. Le problème provient-il de prestashop ou d'O2SWITCH ? Ils ont fait une restauration des sites avec les sauvegardes, mais le problème est toujours là. Que faire ?? Merci Link to comment Share on other sites More sharing options...
juanrojas Posted 15 hours ago Share Posted 15 hours ago Bonjour, quelle version de Prestashop ? Version PHP ? est-ce un multi-magasin ? Link to comment Share on other sites More sharing options...
Amaltheus Posted 15 hours ago Author Share Posted 15 hours ago Bonjour, Non ce n'est pas une multiboutique, mais des sites indépendants. Version de prestashop 1.7.8 Version php : 7.4 Link to comment Share on other sites More sharing options...
Mediacom87 Posted 15 hours ago Share Posted 15 hours ago Bonjour, L'erreur est la même après restauration, car maintenant que la restauration fut faite, on est certainement sur un nouveau problème. Avez-vous tenté de vider manuellement le cache de PrestaShop : https://www.mediacom87.fr/faq-comment-vider-le-cache-manuellement-sur-prestashop-17/ Êtes-vous certain de bien être en PHP 7.4 ? Link to comment Share on other sites More sharing options...
Amaltheus Posted 15 hours ago Author Share Posted 15 hours ago Oui je suis bien en version php 7.4, je viens de vérifier dans Cpanel. Je suis en train de vider le cache d'un des sites pour voir, c'est assez long, je vous donne le résultat dès que c'est fini Link to comment Share on other sites More sharing options...
Amaltheus Posted 15 hours ago Author Share Posted 15 hours ago Cache vidé sur mon site www.amaltheus.fr Toujours le même message en mode debug (actuellement activé) Fatal error: Uncaught Error: Call to undefined function PrestaShop\PrestaShop\Core\Addon\Theme\json_decode() in /home/amaltheus/amaltheus.fr/src/Core/Addon/Theme/ThemeRepository.php:169 Stack trace: #0 /home/amaltheus/amaltheus.fr/src/Core/Addon/Theme/ThemeRepository.php(83): PrestaShop\PrestaShop\Core\Addon\Theme\ThemeRepository->getConfigFromFile('/home/amaltheus...') #1 /home/amaltheus/amaltheus.fr/classes/shop/Shop.php(495): PrestaShop\PrestaShop\Core\Addon\Theme\ThemeRepository->getInstanceByName('classic') #2 /home/amaltheus/amaltheus.fr/classes/shop/Shop.php(137): ShopCore->setTheme() #3 /home/amaltheus/amaltheus.fr/classes/shop/Shop.php(415): ShopCore->__construct('1') #4 /home/amaltheus/amaltheus.fr/config/config.inc.php(128): ShopCore::initialize() #5 /home/amaltheus/amaltheus.fr/index.php(27): require('/home/amaltheus...') #6 {main} thrown in /home/amaltheus/amaltheus.fr/src/Core/Addon/Theme/ThemeRepository.php on line 169 Link to comment Share on other sites More sharing options...
Eolia Posted 14 hours ago Share Posted 14 hours ago il y a quoi dans ce fichier à la ligne 169 ? /home/amaltheus/pierres-polies.fr/src/Core/Addon/Theme/ThemeRepository.php:169 Link to comment Share on other sites More sharing options...
Amaltheus Posted 14 hours ago Author Share Posted 14 hours ago /** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors <[email protected]> * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Core\Addon\Theme; use PrestaShop\PrestaShop\Core\Addon\AddonListFilter; use PrestaShop\PrestaShop\Core\Addon\AddonListFilterStatus; use PrestaShop\PrestaShop\Core\Addon\AddonListFilterType; use PrestaShop\PrestaShop\Core\Addon\AddonRepositoryInterface; use PrestaShop\PrestaShop\Core\ConfigurationInterface; use PrestaShopException; use Shop; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Yaml\Parser; class ThemeRepository implements AddonRepositoryInterface { /** * @var ConfigurationInterface */ private $appConfiguration; /** * @var Filesystem */ private $filesystem; /** * @var Shop|null */ private $shop; /** * @var array */ public $themes; public function __construct(ConfigurationInterface $configuration, Filesystem $filesystem, Shop $shop = null) { $this->appConfiguration = $configuration; $this->filesystem = $filesystem; $this->shop = $shop; } /** * @param string $name * * @return \PrestaShop\PrestaShop\Core\Addon\AddonInterface|Theme * * @throws PrestaShopException */ public function getInstanceByName($name) { $dir = $this->appConfiguration->get('_PS_ALL_THEMES_DIR_') . $name; $confDir = $this->appConfiguration->get('_PS_CONFIG_DIR_') . 'themes/' . $name; $jsonConf = $confDir . '/theme.json'; if ($this->shop) { $jsonConf = $confDir . '/shop' . $this->shop->id . '.json'; } if ($this->filesystem->exists($jsonConf)) { $data = $this->getConfigFromFile($jsonConf); } else { $data = $this->getConfigFromFile($dir . '/config/theme.yml'); // Write parsed yml data into json conf (faster parsing next time) $this->filesystem->dumpFile($jsonConf, json_encode($data)); } $data['directory'] = $dir; return new Theme($data); } public function getList() { if (!isset($this->themes)) { $this->themes = $this->getFilteredList(new AddonListFilter()); } return $this->themes; } /** * Gets list of themes as a collection. * * @return ThemeCollection */ public function getListAsCollection() { $list = $this->getList(); return ThemeCollection::createFrom($list); } public function getListExcluding(array $exclude) { $filter = (new AddonListFilter()) ->setExclude($exclude); return $this->getFilteredList($filter); } public function getFilteredList(AddonListFilter $filter) { $filter->setType(AddonListFilterType::THEME); if (!isset($filter->status)) { $filter->setStatus(AddonListFilterStatus::ALL); } $themes = $this->getThemesOnDisk(); if (count($filter->exclude) > 0) { foreach ($filter->exclude as $name) { unset($themes[$name]); } } return $themes; } private function getThemesOnDisk() { $suffix = 'config/theme.yml'; $themeDirectories = glob($this->appConfiguration->get('_PS_ALL_THEMES_DIR_') . '*/' . $suffix, GLOB_NOSORT); $themes = []; foreach ($themeDirectories as $directory) { $name = basename(substr($directory, 0, -strlen($suffix))); $themes[$name] = $this->getInstanceByName($name); } return $themes; } private function getConfigFromFile($file) { if (!$this->filesystem->exists($file)) { throw new PrestaShopException(sprintf('[ThemeRepository] Theme configuration file not found for theme at `%s`.', $file)); } $content = file_get_contents($file); if (preg_match('/.\.(yml|yaml)$/', $file)) { return (new Parser())->parse($content); } elseif (preg_match('/.\.json$/', $file)) { return json_decode($content, true); } } } la ligne 169 est la dernière ligne : return json_decode($content, true); Link to comment Share on other sites More sharing options...
Eolia Posted 13 hours ago Share Posted 13 hours ago Dans cotre cpanel, version php => extensions, cette case est bien cochée ? Link to comment Share on other sites More sharing options...
Amaltheus Posted 13 hours ago Author Share Posted 13 hours ago Oui json est bien coché, je vais faire une capture d'écran de la configuration php Link to comment Share on other sites More sharing options...
Amaltheus Posted 12 hours ago Author Share Posted 12 hours ago en fichier-joint une capture d'écran des options php Link to comment Share on other sites More sharing options...
Amaltheus Posted 12 hours ago Author Share Posted 12 hours ago Les techniciens d'O2SWITCH ont trouvé et réparé le bug. Un grand merci à toutes les personnes qui ont tenté de réparer ce bug sur ce forum. Link to comment Share on other sites More sharing options...
Eolia Posted 11 hours ago Share Posted 11 hours ago On peut connaitre la raison ? Ca pourrait être utile à d'autres. Link to comment Share on other sites More sharing options...
Amaltheus Posted 11 hours ago Author Share Posted 11 hours ago J'ai demandé au technicien, j'attends la réponse. J'aimerai bien savoir aussi d'où venait ce problème, de prestashop ou de l'hébergeur ??? Link to comment Share on other sites More sharing options...
Amaltheus Posted 10 hours ago Author Share Posted 10 hours ago Voici la réponse du support technique d'O2Switch : C'est un souci de connexion à l'extension .json, il suffit de recharger le php de l'hébergement pour que cela fonctionne. Vous étiez sur la bonne piste avec le .json 👍🙂 MERCI encore à tous Link to comment Share on other sites More sharing options...
Mediacom87 Posted 6 hours ago Share Posted 6 hours ago 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