diff --git a/advancedeucompliance.php b/advancedeucompliance.php index be252db..2868e94 100644 --- a/advancedeucompliance.php +++ b/advancedeucompliance.php @@ -75,7 +75,7 @@ public function __construct( ) { $this->name = 'advancedeucompliance'; $this->tab = 'administration'; - $this->version = '3.1.1'; + $this->version = '3.1.2'; $this->author = 'thirty bees'; $this->need_instance = 0; $this->bootstrap = true; @@ -489,11 +489,10 @@ public function hookActionEmailAddAfterContent($param) $idLang = (int) $param['id_lang']; $mailId = AeucEmailEntity::getMailIdFromTplFilename($tplName); - if (!isset($mailId['id_mail'])) { + if (!$mailId) { return; } - $mailId = (int) $mailId['id_mail']; $cmsRoleIds = AeucCMSRoleEmailEntity::getCMSRoleIdsFromIdMail($mailId); if (!$cmsRoleIds) { return; diff --git a/classes/AeucEmailEntity.php b/classes/AeucEmailEntity.php index a584f83..e3af728 100644 --- a/classes/AeucEmailEntity.php +++ b/classes/AeucEmailEntity.php @@ -79,11 +79,11 @@ public static function getAll() /** * @param string $tplName * - * @return array + * @return int */ public static function getMailIdFromTplFilename($tplName) { - return (array) Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow( + return (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue( (new DbQuery()) ->select('`'.bqSQL(static::$definition['primary']).'`') ->from(bqSQL(static::$definition['table']))