bug f5 après masque de saisie incomplet

This commit is contained in:
Fred Tempez 2020-09-22 18:54:14 +02:00
parent 8398aae329
commit 7e8dbc3f0e
1 changed files with 15 additions and 13 deletions

View File

@ -234,7 +234,7 @@ class gallery extends common {
} }
} }
// Soumission du formulaire d'ajout d'une galerie // Soumission du formulaire d'ajout d'une galerie
if($this->isPost()) { if( $this->isPost() ) {
if (!$this->getInput('galleryConfigFilterResponse')) { if (!$this->getInput('galleryConfigFilterResponse')) {
$galleryId = helper::increment($this->getInput('galleryConfigName', helper::FILTER_ID, true), (array) $this->getData(['module', $this->getUrl(0)])); $galleryId = helper::increment($this->getInput('galleryConfigName', helper::FILTER_ID, true), (array) $this->getData(['module', $this->getUrl(0)]));
// définir une vignette par défaut // définir une vignette par défaut
@ -253,18 +253,20 @@ class gallery extends common {
break; break;
} }
} }
$this->setData(['module', $this->getUrl(0), $galleryId, [ if ( $this->getInput('galleryEditName') ) {
'config' => [ $this->setData(['module', $this->getUrl(0), $galleryId, [
'name' => $this->getInput('galleryConfigName'), 'config' => [
'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true), 'name' => $this->getInput('galleryConfigName'),
'homePicture' => $homePicture, 'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true),
'sort' => self::SORT_ASC, 'homePicture' => $homePicture,
'position' => $this->getData(['module',$this->getUrl(0)]) !== null ? count($this->getData(['module',$this->getUrl(0)])) + 1 : 0, 'sort' => self::SORT_ASC,
'fullScreen' => false 'position' => $this->getData(['module',$this->getUrl(0)]) !== null ? count($this->getData(['module',$this->getUrl(0)])) + 1 : 0,
], 'fullScreen' => false
'legend' => [], ],
'positions' => [] 'legend' => [],
]]); 'positions' => []
]]);
}
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl() /*. '#galleryConfigForm'*/, 'redirect' => helper::baseUrl() . $this->getUrl() /*. '#galleryConfigForm'*/,