Skip to content

Commit

Permalink
Implement call to hook filterHtmlContent on modules HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
elburgl69 committed Jan 6, 2021
1 parent bd167b2 commit 571559e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ps_customtext.php
Expand Up @@ -279,12 +279,15 @@ public function renderWidget($hookName = null, array $configuration = [])

public function getWidgetVariables($hookName = null, array $configuration = [])
{
$sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'info_lang`
WHERE `id_lang` = ' . (int) $this->context->language->id . ' AND `id_shop` = ' . (int) $this->context->shop->id;
$ct = new CustomText(1, (int) $this->context->language->id, (int) $this->context->shop->id);
$op = new ObjectPresenter();
$pobj = $op->present($ct);
$pobj['id_lang'] = $this->context->language->id;
$pobj['id_shop'] = $this->context->shop->id;
unset($pobj['id']);
$ret = ['cms_infos' => $pobj];

return [
'cms_infos' => Db::getInstance()->getRow($sql),
];
return $ret;
}

public function installFixtures()
Expand Down
3 changes: 3 additions & 0 deletions tests/phpstan/phpstan.neon
Expand Up @@ -10,6 +10,9 @@ parameters:
ignoreErrors:
- '#If condition is always true.#'
- '#Property CustomText::$text \(string\) does not accept array<int|string, string>.#'
- '#Instantiated class ObjectPresenter not found.#'
- '#Call to method present\(\) on an unknown class ObjectPresenter.#'
- "#Cannot unset offset 'id' on array\\('id_lang' => mixed, 'id_shop' => int\\).#"
## On 1.7.1.0
- '#Call to method assign\(\) on an unknown class Smarty_Data#'
reportUnmatchedIgnoredErrors: false
Expand Down

0 comments on commit 571559e

Please sign in to comment.