Skip to content

Commit

Permalink
Use core method to get hook name
Browse files Browse the repository at this point in the history
  • Loading branch information
Quetzacoalt91 committed Jun 14, 2019
1 parent 89cebc6 commit 05e62d7
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions autoupgrade.php
Expand Up @@ -155,20 +155,16 @@ public function uninstall()
return parent::uninstall();
}

/**
* Register the current module to a given hook and moves it at the first position.
*
* @param string $hookName
*
* @return bool
*/
private function registerHookAndSetToTop($hookName)
{
if ($this->registerHook($hookName)) {
// Update module position in Dashboard
$query = 'SELECT id_hook FROM ' . _DB_PREFIX_ . "hook WHERE name = '" . pSQL($hookName) . "'";
$result = Db::getInstance()->ExecuteS($query);
$id_hook = $result['0']['id_hook'];

$this->updatePosition((int) $id_hook, 0);

return true;
}

return false;
return $this->registerHook($hookName) && $this->updatePosition((int) Hook::getIdByName($hookName), 0);
}

public function hookDashboardZoneOne($params)
Expand Down

0 comments on commit 05e62d7

Please sign in to comment.