Anthony IVOL Posted June 28, 2017 Share Posted June 28, 2017 Hi, How to allow <br> tags in Modules Admin Fields ? I have that in my tinymce config : valid_children: "+*[*]", valid_elements: "*[*]", I tried then in Tools.php line 3703 in purifyHTML function: $def->addElement('br', 'Block', 'Flow', 'Common', array()); then $def->addElement('br', 'Inline', 'Flow', 'Common', array()); then $def->addElement('br'); then I have disabled the htmlPurifier library in Settings > General But nothing seems to work. Working with prestashop 1.7.1.2, and I declare my field like this in my module : array( 'type' => 'textarea', 'autoload_rte' => true, 'lang' => true, 'label' => $this->trans('Truc truc truc', array(), 'Modules.Page_About.Admin'), 'name' => 'TRUC', ), What am I doing wrong ? Thanks Link to comment Share on other sites More sharing options...
Anthony IVOL Posted June 28, 2017 Author Share Posted June 28, 2017 Actually It doesn't allow more than one paragraph also. <p>truc</p><p>another truc</p> becomes : <p>truc another truc</p> Link to comment Share on other sites More sharing options...
Anthony IVOL Posted June 29, 2017 Author Share Posted June 29, 2017 Well, I checked what was actually sent by the form and the Tinymce looks to work well as this code dumps <br> tags : dump(Tools::getValue('TRUC')); die(); Configuration::updateValue('TRUC', Tools::getValue('TRUC')); It means that the problem comes while : Configuration::updateValue('TRUC', Tools::getValue('TRUC')); Link to comment Share on other sites More sharing options...
Anthony IVOL Posted June 29, 2017 Author Share Posted June 29, 2017 (edited) I feel a bit alone here... But I found the solution, the Configuration::updateValue function takes a third argument $html that should be true : public static function updateValue($key, $values, $html = false, $idShopGroup = null, $idShop = null) so this : Configuration::updateValue('TRUC', Tools::getValue('TRUC')); becomes : Configuration::updateValue('TRUC', Tools::getValue('TRUC'), true); tadaaaa ! Edited June 29, 2017 by Anthony IVOL (see edit history) 1 Link to comment Share on other sites More sharing options...
VojtaN Posted July 26, 2017 Share Posted July 26, 2017 Hi, I have same issue. Please, can you give me info in what file you did last fix? 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