[10.0.28.dev] Reset homePage

This commit is contained in:
Fred 2019-10-14 16:56:35 +02:00 committed by GitHub
parent c78484d4b3
commit 1236951cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,11 +225,6 @@ class page extends common {
$this->setData(['page', $hierarchyPageId, 'position', $lastPosition]);
// Incrémente pour la prochaine position
$lastPosition++;
// Une seule homepage, si homePage est true, désactiver les autres pages
if ($this->getinput('pageHomePageId', helper::FILTER_BOOLEAN) === true) {
$this->setData(['page',$hierarchyPageId,"homePageId", false]);
}
}
if ($this->getinput('pageEditBlock') !== 'bar') {
$barLeft = $this->getinput('pageEditBarLeft');
@ -244,6 +239,12 @@ class page extends common {
$position = 0;
$hideTitle = true;
}
// Reset homePage
if ($this->getinput('pageHomePageId', helper::FILTER_BOOLEAN) === true ) {
foreach($hierarchy as $hierarchyPageId) {
$this->setData(['page',$hierarchyPageId,"homePageId", false]);
}
}
// Modifie la page ou en crée une nouvelle si l'id a changé
$this->setData([
'page',