// fix bug with wrong positions when changing parent of tab
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13779 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -445,4 +445,20 @@ class TabCore extends ObjectModel
|
|||||||
$tabs = Tab::recursiveTab($admin_tab['id_parent'], $tabs);
|
$tabs = Tab::recursiveTab($admin_tab['id_parent'], $tabs);
|
||||||
return $tabs;
|
return $tabs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overrides update to set position to last when changing parent tab
|
||||||
|
*
|
||||||
|
* @see ObjectModel::update
|
||||||
|
* @param bool $null_values
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function update($null_values = false)
|
||||||
|
{
|
||||||
|
$current_tab = new Tab($this->id);
|
||||||
|
if ($current_tab->id_parent != $this->id_parent)
|
||||||
|
$this->position = Tab::getNewLastPosition($this->id_parent);
|
||||||
|
|
||||||
|
return parent::update($null_values);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user