PrestaShop / PrestaShop

PrestaShop is the universal open-source software platform to build your e-commerce solution.
https://www.prestashop-project.org/
Other
8.11k stars 4.79k forks source link

MPN and EAN13 with NULL can give errors in the new product page. Upgrade from 1.7 to 8.1 #34287

Closed maofree closed 8 months ago

maofree commented 11 months ago

Prerequisites

Describe the bug and add attachments

Hi I report an error that I get with some websites after the upgrade from 1.7.8.9 to 8.1.2 using the new product page

it is due from NULL values in the ps_product and ps_product_attribute about these fields mpn ean13 upc isbn

normally I get this problem with mpn and ean13

to solve it I remove the NULL values from those fields

I wanted to warn you about this problem

1 2

bye

Expected behavior

No response

Steps to reproduce

  1. set the new style of product page, admin side
  2. set NULL for a product in the database into ps_product and ps_product_attribute if it has combinations

bye

PrestaShop version(s) where the bug happened

8.1.2

PHP version(s) where the bug happened

8.1

If your bug is related to a module, specify its name and its version

No response

Your company or customer's name goes here (if applicable).

No response

AureRita commented 11 months ago

Hi @maofree

Thank you for your report, I try to reproduce your issue but I can't reproduce it as you can see :

Untitled_ Oct 16, 2023 2_57 PM.webm

Did I miss something ?

Did you change anything else ?

Can you give us a video ? Can you enable debug mode to see your error ?

Waiting for your feedback

maofree commented 11 months ago

Hi the error appears in product page of the back-office, not in the front-office

go to see in the product page of the product with id = 1 (you have tested on this one). If the product has combinations it is necessary to add NULL in ps_product_attribute of that demo product

Hlavtox commented 11 months ago

@maofree @AureRita

Most information - https://github.com/PrestaShop/PrestaShop/issues/22215 Duplicates:

Hlavtox commented 11 months ago

@maofree Run these queries, it will fix the DB ;-) https://github.com/PrestaShop/autoupgrade/pull/605/files

maofree commented 11 months ago

@Hlavtox thanks for this file it is for 8.1.1, so why in the 8.1.2 I got this problem? in theory it should correct these things itself by updating to 8.1.1 and later. Maybe the fix was applied after I had already updated to 8.1.1

Hlavtox commented 11 months ago

@maofree It wasn't merged, it's not a permanent good solution because for example even the built in backup function will mess up the data. :(

Backup DB using backoffice > restore it > errors with NULL values everywhere.

florine2623 commented 11 months ago

@maofree ,

I can't reproduce your issue.

I created 1 product (id 23) on 1.7.8.9 with the options ISBN, EAN, MPN, UPC and 1 product without anything (id 24). On BO and FO it is OK. On the database, the info is well saved :

Screenshot 2023-10-18 at 15 11 33

I upgraded from 1.7.8.9 to 8.1.2 ✅

Screenshot 2023-10-18 at 15 27 50

After the upgrade, I checked the BO and FO, both of the product pages are well displayed.

The only problem that I have is that the format of ISBN is not correct so I have an error like this :

Screenshot 2023-10-18 at 15 29 50
maofree commented 11 months ago

Hi @florine2623 @Hlavtox knows this problem to reproduce this error, you need to go in the phpmyadmin and set NULL into the ean13 or mpn field (if the product has combinations you need to do that into ps_product_attribute) then go to the product page back-office side and you will get this error

Hlavtox commented 11 months ago

@florine2623 It happens only on installs upgraded from older versions of prestashop. It's a legit issue open million times before.

florine2623 commented 11 months ago

Oh yes sorry. I have reproduced the issue now 😅

Screenshot 2023-10-18 at 16 03 43

Here are the exact steps I followed :

MatShir commented 11 months ago

Do you know where the NULL could come from ?

florine2623 commented 8 months ago

@MatShir it is modified directly in the database

MatShir commented 8 months ago

My question was for @maofree and @Hlavtox if they had hint on why we add NULL values

maofree commented 8 months ago

@MatShir I don't know the answer, maybe it was something that happened on the first versions of prestashop 1.7

Hlavtox commented 8 months ago

Everything is here - https://github.com/PrestaShop/PrestaShop/issues/34454

I think we can close this issue

Hlavtox commented 8 months ago

Closing in favor of https://github.com/PrestaShop/PrestaShop/issues/34454