From 7e8dbc3f0e9044fb3b9379f83c6602d91ed7bf70 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 22 Sep 2020 18:54:14 +0200 Subject: [PATCH] =?UTF-8?q?bug=20f5=20apr=C3=A8s=20masque=20de=20saisie=20?= =?UTF-8?q?incomplet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/gallery/gallery.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index 36121257..9cf46ecb 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -234,7 +234,7 @@ class gallery extends common { } } // Soumission du formulaire d'ajout d'une galerie - if($this->isPost()) { + if( $this->isPost() ) { if (!$this->getInput('galleryConfigFilterResponse')) { $galleryId = helper::increment($this->getInput('galleryConfigName', helper::FILTER_ID, true), (array) $this->getData(['module', $this->getUrl(0)])); // définir une vignette par défaut @@ -253,18 +253,20 @@ class gallery extends common { break; } } - $this->setData(['module', $this->getUrl(0), $galleryId, [ - 'config' => [ - 'name' => $this->getInput('galleryConfigName'), - 'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true), - 'homePicture' => $homePicture, - 'sort' => self::SORT_ASC, - 'position' => $this->getData(['module',$this->getUrl(0)]) !== null ? count($this->getData(['module',$this->getUrl(0)])) + 1 : 0, - 'fullScreen' => false - ], - 'legend' => [], - 'positions' => [] - ]]); + if ( $this->getInput('galleryEditName') ) { + $this->setData(['module', $this->getUrl(0), $galleryId, [ + 'config' => [ + 'name' => $this->getInput('galleryConfigName'), + 'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true), + 'homePicture' => $homePicture, + 'sort' => self::SORT_ASC, + 'position' => $this->getData(['module',$this->getUrl(0)]) !== null ? count($this->getData(['module',$this->getUrl(0)])) + 1 : 0, + 'fullScreen' => false + ], + 'legend' => [], + 'positions' => [] + ]]); + } // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl() /*. '#galleryConfigForm'*/,