From 666b564215e29861121c510dee97781ae910ea5e Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sun, 12 Nov 2023 18:23:52 +0100 Subject: [PATCH] fix bug sitemap 13008 --- CHANGES.md | 5 +++++ LISEZMOI.md | 2 +- README.md | 2 +- core/core.php | 16 +++++++--------- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 26acfe08..c5d46bb6 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # Changelog +## Version 13.0.08 + +## Corrections +-Corrige un bug dans la génération du sitemap. + ## Version 13.0.07 ## Corrections diff --git a/LISEZMOI.md b/LISEZMOI.md index 349411c9..b046049e 100644 --- a/LISEZMOI.md +++ b/LISEZMOI.md @@ -1,4 +1,4 @@ -# ZwiiCMS 13.0.07 +# ZwiiCMS 13.0.08 Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. diff --git a/README.md b/README.md index 9da94407..b1b0ec1b 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ZwiiCMS 13.0.07 +# ZwiiCMS 13.0.08 Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge. diff --git a/core/core.php b/core/core.php index 010eca20..77f94e2d 100644 --- a/core/core.php +++ b/core/core.php @@ -51,7 +51,7 @@ class common const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '13.0.07'; + const ZWII_VERSION = '13.0.08'; // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/cms-update/raw/branch/master/'; @@ -1061,7 +1061,7 @@ class common // Page désactivée, traiter les sous-pages sans prendre en compte la page parente. if ($this->getData(['page', $parentPageId, 'disable']) !== true) { // Cas de la page d'accueil ne pas dupliquer l'URL - $pageId = ($parentPageId !== $this->homePageId()) ? $parentPageId : ''; + $pageId = ($parentPageId !== $this->getData(['locale', 'homePageId'])) ? $parentPageId : ''; $sitemap->addUrl('/' . $pageId, $datetime); $flag = true; } @@ -1073,9 +1073,8 @@ class common foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) { if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) { $date = $this->getData(['module', $parentPageId, 'posts', $articleId, 'publishedOn']); - $sitemap->addUrl('/' . $parentPageId . '/' . $articleId, new DateTime('@{$date}', new DateTimeZone($timezone))); - $flag = true; - } + $sitemap->addUrl('/' . $parentPageId . '/' . $articleId, new DateTime("@{$date}", new DateTimeZone($timezone))); + } } } // Sous-pages @@ -1084,7 +1083,7 @@ class common continue; } // Cas de la page d'accueil ne pas dupliquer l'URL - $pageId = ($childKey !== $this->homePageId()) ? $childKey : ''; + $pageId = ($childKey !== $this->getData(['locale', 'homePageId'])) ? $childKey : ''; $sitemap->addUrl('/' . $childKey, $datetime); $flag = true; @@ -1096,9 +1095,8 @@ class common foreach ($this->getData(['module', $childKey, 'posts']) as $articleId => $article) { if ($this->getData(['module', $childKey, 'posts', $articleId, 'state']) === true) { $date = $this->getData(['module', $childKey, 'posts', $articleId, 'publishedOn']); - $sitemap->addUrl('/' . $childKey . '/' . $articleId, new DateTime('@{$date}', new DateTimeZone($timezone))); - $flag = true; - } + $sitemap->addUrl('/' . $childKey . '/' . $articleId, new DateTime("@{$date}", new DateTimeZone($timezone))); + } } } }