Jump to content

[PS 1.7.7.5] Unable to save product fields in particular scenarios


PrestashopLearner

Recommended Posts

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 by PrestashopLearner (see edit history)
Link to comment
Share on other sites

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 by PrestashopLearner
not precise enough (see edit history)
Link to comment
Share on other sites

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

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

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

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

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:

image.png.3314cfe7eb0242f9e21b8e72a0187280.png

 

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 by PrestashopLearner (see edit history)
  • Confused 1
Link to comment
Share on other sites

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:

image.png.3314cfe7eb0242f9e21b8e72a0187280.png

 

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 by kmiller10
grammar & spellings (see edit history)
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...