// same for unregister hook

This commit is contained in:
Rémi Gaillard
2013-07-01 16:30:53 +02:00
parent 09359d011f
commit c5fc26ed0b
5 changed files with 44 additions and 2 deletions

View File

@@ -731,11 +731,16 @@ abstract class ModuleCore
// Get hook id if a name is given as argument
if (!is_numeric($hook_id))
{
$hook_name = (int)$hook_id;
// Retrocompatibility
$hook_id = Hook::getIdByName($hook_id);
if (!$hook_id)
return false;
}
else
$hook_name = Hook::getNameById((int)$hook_id);
Hook::exec('actionModuleUnRegisterHookBefore', array('object' => $this, 'hook_name' => $hook_name));
// Unregister module on hook by id
$sql = 'DELETE FROM `'._DB_PREFIX_.'hook_module`
@@ -746,6 +751,8 @@ abstract class ModuleCore
// Clean modules position
$this->cleanPositions($hook_id, $shop_list);
Hook::exec('actionModuleUnRegisterHookAfter', array('object' => $this, 'hook_name' => $hook_name));
return $result;
}