From e242d7ecab037a7f1e38c0be9c164a438745d0cc Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 18 Jul 2023 22:26:07 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20param=C3=A8tres=20null=20dans=20ge?= =?UTF-8?q?tHierarchy=20et=20effacement=20des=20donn=C3=A9es=20de=20sessio?= =?UTF-8?q?n=20et=20de=20cookies=20relatif=20aux=20langues=20lors=20de=20l?= =?UTF-8?q?a=20r=C3=A9installation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 2 +- core/include/update.inc.php | 18 +++++++++--------- core/module/install/install.php | 5 +++++ core/module/plugin/plugin.php | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/core/core.php b/core/core.php index fe76b107..33d23ae7 100644 --- a/core/core.php +++ b/core/core.php @@ -1010,7 +1010,7 @@ class common $datetime = new DateTime(date('c')); $datetime->format(DateTime::ATOM); // Updated ISO8601 - foreach ($this->getHierarchy(null, null, null) as $parentPageId => $childrenPageIds) { + foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) { // Exclure les barres et les pages non publiques et les pages masquées if ( $this->getData(['page', $parentPageId, 'group']) !== 0 || diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 7d398c56..1854bd75 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -19,7 +19,7 @@ if ($this->getData(['core', 'dataVersion']) < 10000) { //---------------------------------------- // Mettre à jour les données des galeries $pageList = array(); - foreach ($this->getHierarchy(null, null, null) as $parentKey => $parentValue) { + foreach ($this->getHierarchy() as $parentKey => $parentValue) { $pageList[] = $parentKey; foreach ($parentValue as $childKey) { $pageList[] = $childKey; @@ -179,7 +179,7 @@ if ($this->getData(['core', 'dataVersion']) < 10300) { $this->setData(['config', 'searchPageId', '']); // Mettre à jour les données des galeries - $pageList = array(); foreach ($this->getHierarchy(null, null, null) as $parentKey => $parentValue) { + $pageList = array(); foreach ($this->getHierarchy() as $parentKey => $parentValue) { $pageList[] = $parentKey; foreach ($parentValue as $childKey) { $pageList[] = $childKey; @@ -240,7 +240,7 @@ if ($this->getData(['core', 'dataVersion']) < 10304) { if ($this->getData(['core', 'dataVersion']) < 10306) { // Liste des pages $pageList = array(); - foreach ($this->getHierarchy(null, null, null) as $parentKey => $parentValue) { + foreach ($this->getHierarchy() as $parentKey => $parentValue) { $pageList[] = $parentKey; foreach ($parentValue as $childKey) { $pageList[] = $childKey; @@ -298,7 +298,7 @@ if ($this->getData(['core', 'dataVersion']) < 10400) { // Ajouter les champs de blog v3 // Liste des pages dans pageList $pageList = array(); - foreach ($this->getHierarchy(null, null, null) as $parentKey => $parentValue) { + foreach ($this->getHierarchy() as $parentKey => $parentValue) { $pageList[] = $parentKey; foreach ($parentValue as $childKey) { $pageList[] = $childKey; @@ -389,7 +389,7 @@ if ($this->getData(['core', 'dataVersion']) < 10600) { // Liste des pages dans pageList $pageList = array(); - foreach ($this->getHierarchy(null, null, null) as $parentKey => $parentValue) { + foreach ($this->getHierarchy() as $parentKey => $parentValue) { $pageList[] = $parentKey; foreach ($parentValue as $childKey) { $pageList[] = $childKey; @@ -451,7 +451,7 @@ if ($this->getData(['core', 'dataVersion']) < 11000) { if (!is_dir(self::DATA_DIR . self::$i18nContent . '/content')) { mkdir(self::DATA_DIR . self::$i18nContent . '/content', 0755); } - foreach ($this->getHierarchy(null, null, null) as $parentKey => $parentValue) { + foreach ($this->getHierarchy() as $parentKey => $parentValue) { $pageList[] = $parentKey; foreach ($parentValue as $childKey) { $pageList[] = $childKey; @@ -509,7 +509,7 @@ if ($this->getData(['core', 'dataVersion']) < 11200) { $this->setData(['config', 'connect', 'captchaType', 'alpha']); // Ajout de la variable shortTitle basée sur Title - foreach ($this->getHierarchy(null, null, null) as $parentKey => $parentValue) { + foreach ($this->getHierarchy() as $parentKey => $parentValue) { $pageList[] = $parentKey; foreach ($parentValue as $childKey) { $pageList[] = $childKey; @@ -573,7 +573,7 @@ if ($this->getData(['core', 'dataVersion']) < 11203) { $c3 = 0; $success = false; // Boucler sur les pages - foreach ($this->getHierarchy(null, null, null) as $parentId => $childIds) { + foreach ($this->getHierarchy() as $parentId => $childIds) { $content = $this->getPage($parentId, self::$i18nContent); $titre = $this->getData(['page', $parentId, 'title']); $content = $titre . ' ' . $content; @@ -669,7 +669,7 @@ if ($this->getData(['core', 'dataVersion']) < 11300) { if ($this->getData(['core', 'dataVersion']) < 11303) { // Ajout de la variable shortTitle basée sur Title - foreach ($this->getHierarchy(null, null, null) as $parentKey => $parentValue) { + foreach ($this->getHierarchy() as $parentKey => $parentValue) { $pageList[] = $parentKey; foreach ($parentValue as $childKey) { $pageList[] = $childKey; diff --git a/core/module/install/install.php b/core/module/install/install.php index 2fbf6d13..d6be0d5b 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -75,6 +75,11 @@ class install extends common self::$i18nFiles[$lang] = self::$languages[$lang]; } } + // Effacer le cookie de l'UI et de contenu + unset($_SESSION['ZWII_UI']); + unset($_SESSION['ZWII_CONTENT']); + setcookie('ZWII_UI', '', time() - 3600, helper::baseUrl(false, false)); + $this->addOutput([ 'display' => self::DISPLAY_LAYOUT_LIGHT, diff --git a/core/module/plugin/plugin.php b/core/module/plugin/plugin.php index 37209c77..f45efae8 100644 --- a/core/module/plugin/plugin.php +++ b/core/module/plugin/plugin.php @@ -830,7 +830,7 @@ class plugin extends common * Liste des pages sans module * et ne sont pas des barres latérales */ - self::$pagesList = $this->getHierarchy(null, null, null); + self::$pagesList = $this->getHierarchy(); foreach (self::$pagesList as $page => $value) { if ( $this->getData(['page', $page, 'block']) === 'bar' ||