spinelle Posted August 12, 2014 Share Posted August 12, 2014 Hello, I try to valide a module in PrestaShop Validator, but I have an error. I want to use a categories tree so I use something like this in php: for >= 1.6.0: $helper = new HelperTreeCategories('categories-treeview'); $category_tree = $helper->render(); for < 1.6.0: $helper = new Helper();$category_tree = $helper->renderCategoryTree(); and this in my template: {$category_tree} The category_tree variable is HTML. The error in the validator is: "Variable should be escaped, modifier not found ('htmlall', 'intval', etc.)." What should I do? Thanks Link to comment Share on other sites More sharing options...
vekia Posted August 12, 2014 Share Posted August 12, 2014 duplicated? http://www.prestashop.com/forums/topic/349778-module-validator-category-tree/ Link to comment Share on other sites More sharing options...
spinelle Posted August 12, 2014 Author Share Posted August 12, 2014 Well, I try in french and english, to have an answer as fast as possible. Link to comment Share on other sites More sharing options...
vekia Posted August 12, 2014 Share Posted August 12, 2014 you have to use escaping in that way: {$category_tree|escape:'html':'UTF-8'} Link to comment Share on other sites More sharing options...
spinelle Posted August 12, 2014 Author Share Posted August 12, 2014 Thanks, but like I said it's HTML, so if I do so it won't work anymore. Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2014 Share Posted August 13, 2014 can you show code where you use this variable? what this variable contains? why it will not work anymore? Link to comment Share on other sites More sharing options...
spinelle Posted August 13, 2014 Author Share Posted August 13, 2014 Thank you for your help. The code with the variable is like this: <div id="categories"> <p>{l s='Categories' mod='modulename'}</p> {$category_tree}</div> The variable content the tree category. I got it with this: for >= 1.6.0: $helper = new HelperTreeCategories('categories-treeview'); $category_tree = $helper->render(); for < 1.6.0: $helper = new Helper();$category_tree = $helper->renderCategoryTree(); If I use "{$category_tree|escape:'html':'UTF-8'}" there is no category tree anymore but the HTML code in text. I join pictures of the two exemples (with and without escape) I hope this will be more understandable. (And I apologize for my english) Link to comment Share on other sites More sharing options...
spinelle Posted August 20, 2014 Author Share Posted August 20, 2014 Any ideas ? Link to comment Share on other sites More sharing options...
vekia Posted August 22, 2014 Share Posted August 22, 2014 and the same if you use only escape:'UTF-8' ? Link to comment Share on other sites More sharing options...
spinelle Posted August 22, 2014 Author Share Posted August 22, 2014 That works ! Thank you. Link to comment Share on other sites More sharing options...
vekia Posted August 23, 2014 Share Posted August 23, 2014 finally :-) glad to hear that i could help a little i marked topic title as solved with regards, Milos Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now