PrestashopLearner Posted August 11, 2021 Share Posted August 11, 2021 (edited) Hello, guys! I encounter an issue when trying to save/edit or add products in the BO. I encounter "Unable to update settings" when: - I use accented characters in product description or other product related field. - I add HTML attributes to the HTML elements from the code popup (e.q.: description field: <p style="font-size: 10pt; font-style: normal;">test</p>). If I remove the "style" attribute, everything works. Would really appreciate any input or ideas into the right direction. Thanks! Edited August 11, 2021 by PrestashopLearner (see edit history) Link to comment Share on other sites More sharing options...
knut4shop Posted August 11, 2021 Share Posted August 11, 2021 Hi, i know with Prestashop there are lot of restrictions. Have you also tried to use class? Are there any informations about this issue in the log available? Link to comment Share on other sites More sharing options...
PrestashopLearner Posted August 11, 2021 Author Share Posted August 11, 2021 (edited) 49 minutes ago, knut4shop said: Hi, i know with Prestashop there are lot of restrictions. Have you also tried to use class? Are there any informations about this issue in the log available? Hi, I am not sure I understand what using "class" means. You mean trying to override Validate.php? No helpful information found in logs, unfortunately. Any idea what could cause not being able to write html element attributes (e.g.: <p style="font-size: 10pt; font-style: normal;">test</p>)? Edited August 11, 2021 by PrestashopLearner not precise enough (see edit history) Link to comment Share on other sites More sharing options...
knut4shop Posted August 11, 2021 Share Posted August 11, 2021 Hi, sorry for my bad explanation. With class i mean, add a class-attribut to your tag and style it to your css-file. Quote <p class=”myclass“> I had the same issue as i tried to add a custom form inside my description field and found out there was a restriction. I don‘t know exactly, it was on ps 1.5 but i think, there was an issue with „strip_tags“ function in earlier versions. Have you also tried with debug-mode? Link to comment Share on other sites More sharing options...
PrestashopLearner Posted August 11, 2021 Author Share Posted August 11, 2021 32 minutes ago, knut4shop said: Hi, sorry for my bad explanation. With class i mean, add a class-attribut to your tag and style it to your css-file. I had the same issue as i tried to add a custom form inside my description field and found out there was a restriction. I don‘t know exactly, it was on ps 1.5 but i think, there was an issue with „strip_tags“ function in earlier versions. Have you also tried with debug-mode? Thank you a lot for your explanation. Yes, it's working with "class" attr, and I admin it is a more elegant solution than inline css. The only problem is the time consuming process that would mean if I should do this to hundreds of products (maybe run a script?). The sad thing is that the products are imported and the import was a success, but all of them have accent characters or inline css that will cause an issue. I tested on PS Demo instance online and it's working with inline CSS, so I am hoping for a solution that would meet this requirement. Thank you again for the tip. Link to comment Share on other sites More sharing options...
PrestashopLearner Posted August 11, 2021 Author Share Posted August 11, 2021 Anybody, any idea what would cause this behavior? Link to comment Share on other sites More sharing options...
knut4shop Posted August 11, 2021 Share Posted August 11, 2021 Quote The only problem is the time consuming process that would mean if I should do this to hundreds of products (maybe run a script?) This will be simple if you have full access to database. In this case, you can run a update statemant with the replace() function. Quote update <table> set <column> = replace(<column>,'<exact string pattern>','<exact string pattern>') where <column> like '%<search string>%‘ Before you run this statemant i would complete the where part with a unique product id. Link to comment Share on other sites More sharing options...
PrestashopLearner Posted August 11, 2021 Author Share Posted August 11, 2021 1 hour ago, knut4shop said: This will be simple if you have full access to database. In this case, you can run a update statemant with the replace() function. Before you run this statemant i would complete the where part with a unique product id. I appreciate the idea but this would not solve the underlying issue. Even tho' I would move any inline css to theme's custom.css, I still would not be able to use accented characters in my product description, and this is a must. So I think I should still wait for a direction about the underlying cause. Thank you! Link to comment Share on other sites More sharing options...
knut4shop Posted August 11, 2021 Share Posted August 11, 2021 In my opinion, you have to modify the html-purifer class to allow inline css. In my actual version (1.7.6.9) it can be disabled, but it is it strictly not recommanded to do this. Hope this a better solution for you. Link to comment Share on other sites More sharing options...
PrestashopLearner Posted August 11, 2021 Author Share Posted August 11, 2021 (edited) 9 hours ago, knut4shop said: In my opinion, you have to modify the html-purifer class to allow inline css. In my actual version (1.7.6.9) it can be disabled, but it is it strictly not recommanded to do this. Hope this a better solution for you. Thank you for your advice. I tried disabling HTML Purifier in BO Preferences but the issue persist. I still get: And also 404 Not Found for [DOMAIN]/[ADMIN-FOLDER]/index.php/sell/catalog/products/[ID]?_token=[TOKEN] - AJAX POST when trying to save the product. If I dont do inline CSS or accented characters I dont get 404. Really dont get it Edited August 12, 2021 by PrestashopLearner (see edit history) 1 Link to comment Share on other sites More sharing options...
kmiller10 Posted August 12, 2021 Share Posted August 12, 2021 (edited) On 8/12/2021 at 3:20 AM, PrestashopLearner said: Thank you for your advice. I tried disabling HTML Purifier in BO Preferences but the issue persist. I still get: And also 404 Not Found for [DOMAIN]/[ADMIN-FOLDER]/index.php/sell/catalog/filesynced/products/[ID]?_token=[TOKEN] - AJAX POST when trying to save the product. If I don't do inline CSS or accented characters I don't get 404. Really dont get it. Using the Code Source from the tinymce editor for CMS Pages (For example) I can use whatever I want. This happens only on product level fields. I also tried disabling HTML purifier but no luck. Anyway to fix this? Edited August 13, 2021 by kmiller10 grammar & spellings (see edit history) 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