From 290aab12d8861bddf92f1caf0e7161872eb20cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Thu, 2 Jun 2022 14:35:31 +0200 Subject: [PATCH] =?UTF-8?q?11503=20Affiche=20les=20options=20d'=C3=A9ditio?= =?UTF-8?q?n=20lorsque=20le=20module=20de=20la=20page=20a=20=C3=A9t=C3=A9?= =?UTF-8?q?=20effac=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 1 + core/core.php | 8 ++++++-- core/module/page/view/edit/edit.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index aa509e67..485c088a 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ - Bug de la génération des feuilles de style des fontes, nouvelle correction. ### Amélioration : - Responsive File Manager (RFM), 4 scripts externes sont chargés à partir du site et non d'un CDN (jquery, fabric, filesaver et jplayer). +- Edition d'une page contenant un module effacé sur le disque, la modification et l'effacement de la page sont autorisés. ## Version 11.5.02 ### Corrections : diff --git a/core/core.php b/core/core.php index 09ae33ee..a626e41c 100644 --- a/core/core.php +++ b/core/core.php @@ -2092,6 +2092,8 @@ class common { $this->output['showBarEditButton'] // Sur une page sans module OR $this->getData(['page', $this->getUrl(0), 'moduleId']) === '' + // Sur une page avec un module invalide + OR !class_exists($this->getData(['page', $this->getUrl(2), 'moduleId'])) // Sur une page d'accueil OR $this->getUrl(0) === '' ) { @@ -2739,10 +2741,12 @@ class core extends common { ' › '. $this->getData(['page', $this->getUrl(0), 'title']); } - // Importe la page + // Importe la page simple sans module ou avec un module inexistant if( $this->getData(['page', $this->getUrl(0)]) !== null - AND $this->getData(['page', $this->getUrl(0), 'moduleId']) === '' + AND ( $this->getData(['page', $this->getUrl(0), 'moduleId']) === '' + OR !class_exists($this->getData(['page', $this->getUrl(0), 'moduleId'])) + ) AND $access ) { $this->addOutput([ diff --git a/core/module/page/view/edit/edit.php b/core/module/page/view/edit/edit.php index e6a1fa82..c03c1b26 100644 --- a/core/module/page/view/edit/edit.php +++ b/core/module/page/view/edit/edit.php @@ -71,7 +71,7 @@ 'En cas de changement de module, les données du module précédent seront supprimées.', 'label' => 'Module', - 'selected' => $this->getData(['page', $this->getUrl(2), 'moduleId']) + 'selected' => class_exists($this->getData(['page', $this->getUrl(2), 'moduleId'])) ? $this->getData(['page', $this->getUrl(2), 'moduleId']) : 0 ]); ?> $this->getData(['page', $this->getUrl(2), 'moduleId'])]); ?>