Prestashop: Adding invalid parameter to Language form and "No picture" image causes a crash.

Created on 18 Dec 2020  路  9Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

When you enter invalid parameters to language(whether add or edit) and add a new "No Picture" image you get a crash, but "No Picture" image saves anyway.

Expected behavior

When adding an invalid parameter to language proper error should be shown and not an exception. Also, it shouldn't save "No Picture" image if form is invalid.

Steps to Reproduce

Steps to reproduce the behavior:

  1. International -> Language
  2. Edit Your primary language
  3. Add invalid value( for exampel name = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ).
  4. Add "No picture" image.
  5. Save (Should get crash here)
  6. Check products in front office, products with no image should have the image you have added (which should have not happened).

Screenshots

image

Additional information

  • PrestaShop version: 1.7.8(develop).
  • PHP version: 7.2
1.7.6.9 1.7.7.0 BO Bug International Languages Major PR available To Do develop

All 9 comments

Hello @JevgenijVisockij ,
Can you specify which PS version you are using ?
Thanks!

Hello @JevgenijVisockij ,
Can you specify which PS version you are using ?
Thanks!

Oh sorry forgot it. Updated the bug report.

Thanks !

I managed to reproduce the bug :
Capture d鈥檈虂cran 2020-12-18 a虁 17 38 33

After encountering the bug, no-image image still shows :
Capture d鈥檈虂cran 2020-12-18 a虁 17 41 27

So I will add this to the debug roadmap.

Thanks!

@florine2623 @hibatallahAouadni Is it a regression compared to 1.7.7.x ?

Hello @marionf

No, it's a not regression cause I reproduced it with PS1.7.6.7, PS1.7.6.9 and PS1.7.7.0.
But, this issue is only occured while creating a new language with name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Edit Your primary language

I didn't reproduce it while editing my default language or any other language, see the attached screenshot below:

image

I just had an error message Cannot add language with invalid data even with debug mode enabled.

Thanks!

Hello @marionf

No, it's a not regression cause I reproduced it with PS1.7.6.7, PS1.7.6.9 and PS1.7.7.0.
But, this issue is only occured while creating a new language with name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Edit Your primary language

I didn't reproduce it while editing my default language or any other language, see the attached screenshot below:

image

I just had an error message Cannot add language with invalid data even with debug mode enabled.

Thanks!

I am able to reproduce this fully on fresh PS1.7.6.9. I wonder what could we do diffrently.

Product without image(but uses default "No picture" image.
image

Attempting to save primary Language. Changed name to aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and added different "No picture" image.
image

Result from save(Debug mode is off by default).
image

Same product with, "No picture" image changed successfully despite form crashing.
image

Hello @JevgenijVisockij

Could you please confirm if this PR #21878 could fix this issue or no?

Thanks!

ok thx :slightly_smiling_face:

Hey!

Yes it would.

EDIT: This was supposed to be before

ok thx slightly_smiling_face

But I deleted it since I wanted to modify it slightly, but wasn't fast enough.

Was this page helpful?
0 / 5 - 0 ratings