Skip to content

Commit

Permalink
Fix email attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
firstred committed Nov 28, 2017
1 parent 4ae1df2 commit 19f535c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions advancedeucompliance.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions classes/AeucEmailEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']))
Expand Down

0 comments on commit 19f535c

Please sign in to comment.