Prestashop: An old deleted customization field is copied after duplicating a product

Created on 11 Mar 2020  路  5Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

After duplicating a product, an old deleted customization field is copied to the new product.

Expected behavior

The deleted customization field should not be copied to the new product

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to BO => Products
  2. Create a new product
  3. In the options Tab => add a Customization (all type and could be required or not)
  4. Go to the FO => Product details page => add the customization to the product
  5. Go back to the BO => Last product created => delete the customization
  6. Save
  7. Duplicate this product
  8. Check the copy of the product => the deleted customization field is copied to the new product

Screenshots

https://drive.google.com/file/d/11VFXdx2VUew_SWDYRi0WDj8FvtERf_Sd/view

Additional information

  • PrestaShop version: 1.7.5.2, 1.7.6.4
  • PHP version: 7.2
1.7.5.2 1.7.6.4 BO Bug Customized Minor Products To Do good first issue

All 5 comments

Assign this to me.

@Arman-Hosseini
You should add field is_deleted to SELECT https://github.com/PrestaShop/PrestaShop/blob/1.7.6.x/classes/Product.php#L4569

You have to exclude results with is_deleted = 1 here https://github.com/PrestaShop/PrestaShop/blob/1.7.6.x/classes/Product.php#L4624

if ($customization_field['is_deleted']) {
    continue;
}

Find the best way as you like ;)

Hi @Matt75 ,
Honestly, I'm involved in the discussion here: https://github.com/PrestaShop/PrestaShop/commit/661583e73516cc3118abb27e5e12a296a68658a0#commitcomment-37837650
But thanks for your suggestions :)

Hi @Arman-Hosseini, hope everything's fine for you; do you wish to stay assigned to this issue or should I de-assigned you? You let me know, thanks a lot!

Hi @LouiseBonnard, Hope you are fine.
Sorry, I can't going forward this issue now.

Was this page helpful?
0 / 5 - 0 ratings