This commit is contained in:
Michael RICOIS 2017-11-23 15:08:15 +01:00
parent e2335e71b7
commit 9acc6e29d5
4 changed files with 7 additions and 9 deletions

View File

@ -365,8 +365,6 @@ class AdminGuideCategories extends AdminTab
if (!sizeof($this->_list)) {
echo '<tr><td class="center" colspan="'.(sizeof($this->fieldsDisplay) + 2).'">'.$this->l('No items found').'</td></tr>';
}
$this->_orderBy = 'position';
// Show the content of the table
$this->displayListContent();
@ -379,7 +377,7 @@ class AdminGuideCategories extends AdminTab
public function viewguide_category()
{
global $cookie;
$this->getList((int)($cookie->id_lang));
$this->getList((int)($cookie->id_lang), 'position');
$this->displayList();
$this->displayOptionsList();
$this->displayRequiredFields();

View File

@ -107,7 +107,9 @@ class AdminGuidePosts extends AdminTab
public function displayList()
{
$this->_orderBy = 'position';
if (Tools::getIsset('id_guide_category')) {
$this->_orderBy = 'position';
}
parent::displayList();
}

View File

@ -182,10 +182,8 @@ class GuideCategory extends ObjectModel
public function update($autodate = true, $nullValues = false)
{
$this->position = self::getLastPosition((int)$this->id_parent);
$ret = parent::update($autodate, $nullValues);
$this->cleanupPositions((int)$this->id_parent);
return $ret;
self::cleanupPositions((int)$this->id_parent);
return parent::update($autodate, $nullValues);
}
public function delete()

View File

@ -127,7 +127,7 @@ class GuidePost extends ObjectModel
public function update($autodate = true, $nullValues = false)
{
$this->position = self::cleanupPositions((int)$this->id_guide_category);
self::cleanupPositions((int)$this->id_guide_category);
return parent::update($autodate, $nullValues);
}