Jump to content

[1.6.1.7] erreur module


Recommended Posts

Bonjours à tous :)

 

J'ai cette erreur sur un module perso

 

/views/templates/front/blockextracmsinfo.tpl
Invalid escape modifiers count, could be escaped like: "{$data|escape:'htmlall':'UTF-8'}"
32. ————————————<div·class="col-xs-12·col-sm-{$info.column_size}">{$info.text}</div>
32. ————————————<div·class="col-xs-12·col-sm-{$info.column_size}">{$info.text}</div>

 

le code en question est pour le tempate en question :

{if $infos|@count > 0}
<!-- MODULE extracmsinfo Block -->
<div id="extracmsinfo_block">
		{foreach from=$infos item=info}
			<div class="col-xs-12 col-sm-{$info.column_size}">{$info.text}</div>
		{/foreach}
</div>
<!-- /MODULE extracmsinfo Block -->
{/if}

 Voici le hook qui utilise ce template au besoin ;)

    public function hookHome($params)
    {
        $this->context->controller->addCSS($this->_path.'views/css/extracmsinfo_style.css', 'all');
        if (!$this->isCached('blockextracmsinfo.tpl', $this->getCacheId())) {
            $infos = $this->getInfos($this->context->language->id, $this->context->shop->id);
            $this->context->smarty->assign(array('infos' => $infos, 'nbblocks' => count($infos)));
        }

        return $this->display(__FILE__, 'blockextracmsinfo.tpl', $this->getCacheId());
    }

Si quelqu'un voit ce que cette erreur signifie ;)

Merci d'avance

Link to comment
Share on other sites

/views/templates/front/blockextracmsinfo.tpl

Invalid escape modifiers count, could be escaped like: "{$data|escape:'htmlall':'UTF-8'}"

32. ————————————<div·class="col-xs-12·col-sm-{$info.column_size}">{$info.text}</div>

32. ————————————<div·class="col-xs-12·col-sm-{$info.column_size}">{$info.text}</div>

 

 

1- la ligne 32 apparait 2 fois, donc l'erreur est présente 2 fois dans la ligne.

2- l'erreur est toute simple, les variables doivent êtres échappée, comme par exemple : {$data|escape:'htmlall':'UTF-8'}

3- essaye ceci :

 

{if $infos|@count > 0}
<!-- MODULE extracmsinfo Block -->
<div id="extracmsinfo_block">
		{foreach from=$infos item=info}
			<div class="col-xs-12 col-sm-{$info.column_size|escape:'htmlall':'UTF-8'}">{$info.text|escape:'htmlall':'UTF-8'}</div>
		{/foreach}
</div>
<!-- /MODULE extracmsinfo Block -->
{/if}
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...