Skip to content
Snippets Groups Projects
Commit 9cd04b5f authored by Ghislain Loas's avatar Ghislain Loas
Browse files

CIP #57952 fix save

parent a68e2d27
Branches
Tags
2 merge requests!2334Master,!2079Dev#57952 cip priorisation des ecrans de config
Pipeline #930 failed with stage
in 13 seconds
......@@ -174,7 +174,7 @@ class Class_Systeme_Widget_Menu extends Class_Entity {
if(isset($datas['children']))
$sub_menus = $this->_convertChildren($datas['children']);
if(!$widget->getParent() && $sub_menus) {
if('' == (String) $widget->getParent() && $sub_menus) {
$datas['menus'] = (new Class_Systeme_MenuHorizontal($sub_menus))->asCfgProfil();
return $this->_save($datas);
}
......@@ -210,7 +210,7 @@ class Class_Systeme_Widget_Menu extends Class_Entity {
$profil = $this->getWidget()->getProfil();
$cfg_menus = $profil->getCfgMenusAsArray();
if(!$this->getWidget()->getParent()) {
if('' == (String) $this->getWidget()->getParent()) {
$cfg_menus[$this->getWidget()->getId()] = $datas;
return $profil->setCfgMenus($cfg_menus)->save();
}
......@@ -218,10 +218,9 @@ class Class_Systeme_Widget_Menu extends Class_Entity {
if(!isset($cfg_menus[$this->getWidget()->getParent()]))
return false;
xdebug_break();
$cfg_menus[$this->getWidget()->getParent()] = $this->_findNode($this->getWidget()->getParent());
if(!$this->getWidget()->getPosition()) {
if('' == (String) $this->getWidget()->getPosition()) {
$cfg_menus[$this->getWidget()->getParent()]['menus'][$this->getWidget()->getId()] = $datas;
return $profil->setCfgMenus($cfg_menus)->save();
}
......
......@@ -343,7 +343,7 @@ class MenusNavMenuPostTest extends Admin_AbstractControllerTestCase {
/** @test */
public function profilShouldHaveBeenUpdated() {
$this->assertEquals(['type_menu' => 'PROFIL',
'libelle' => '',
'libelle' => 'new profil',
'picto' => 'home.gif',
'preferences' => ['clef_profil' => '2'],
'id_module' => 1,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment