From 6c55881789d4cf348d77a6a0d98d9428609080ab Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 28 Jul 2023 11:14:13 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20des=20profils=20dans=20l?= =?UTF-8?q?es=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/include/update.inc.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/include/update.inc.php b/core/include/update.inc.php index f39ecb8c..50566a04 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -1025,6 +1025,30 @@ if ($this->getData(['core', 'dataVersion']) < 13000) { break; } } + + //---------------------------------------- + // Mettre à jour les données des galeries + $pageList = array(); + foreach ($this->getHierarchy() as $parentKey => $parentValue) { + $pageList[] = $parentKey; + foreach ($parentValue as $childKey) { + $pageList[] = $childKey; + } + } + + // Mise à jour des pages, le profil est mis à 0 pour les groupes sans profil et 1 pour es groupes avec profil + foreach ($pageList as $parentKey => $parent) { + switch ($this->getData(['page', $parent, 'group'])) { + case 1: + case 2: + $this->setData(['page', $parent, 'profil', 1]); + break; + default: + $this->setData(['page', $parent, 'profil', 0]); + break; + } + } + // Mise à jour $this->setData(['core', 'dataVersion', 13000]); } \ No newline at end of file