Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BO - Products page - an exception is displayed when combination feature is disabled #25782

Closed
dmoibm opened this issue Sep 3, 2021 · 4 comments · Fixed by #25784
Closed

BO - Products page - an exception is displayed when combination feature is disabled #25782

dmoibm opened this issue Sep 3, 2021 · 4 comments · Fixed by #25784
Assignees
Labels
1.7.7.6 Affects versions BO Category: Back Office Bug Type: Bug Combinations Product type: issue about products with combinations Fixed Resolution: issue closed because fixed Major Severity: major bug > https://build.prestashop.com/news/severity-classification Old Products Page Concerns the old product page Performance Label: Which BO under menu is concerned PR available Solution: issue is being addressed Regression Type: regression
Milestone

Comments

@dmoibm
Copy link

dmoibm commented Sep 3, 2021

Describe the bug

After the update from 1.7.7.5 to 1.7.7.7 the error 'Undefined index: attribute_price' appears.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Enable debug mode
  2. Delete all products with combinations
  3. Go to BO > Advanced Parameters > Performance page
  4. Disable Combination
  5. Go to BO > Catalog > Products page
  6. See an error
    image

It is ok with PS1775


It fails on line 3418 (1.7.7.7) in Product.php.
'attribute_price' => $row['attribute_price'] ?: null,

Bevore line 3408 (1.7.7.5) there was this code that works:
'attribute_price' => (isset($row['attribute_price']) ? $row['attribute_price'] : null),

It fails only if the feature Combination is disabled.

I don't understand because this code works in the same environment:

$array2 = [
    "foo" => "bar",
    "bar" => "foo",
];

echo $array2['foos'] ?: "gugus";
  • PrestaShop version: 1.7.7.7
  • PHP version: 7.2.24 on Ubuntu
@khouloudbelguith
Copy link
Contributor

Hi @dmoibm,

Thanks for you report.
Unfortunately, there is not enough information provided to reproduce it and work on it. You must follow the template to submit a complete bug report.
Read more about how we expect the issues to be handled here.

Thanks to edit your first comment.

@khouloudbelguith khouloudbelguith added 1.7.7.7 Affects versions Bug Type: Bug NMI Status: issue needs more information Old Products Page Concerns the old product page Combinations Product type: issue about products with combinations BO Category: Back Office labels Sep 3, 2021
@kpodemski
Copy link
Contributor

kpodemski commented Sep 3, 2021

Thank you @dmoibm

You're right, this check is invalid.

@khouloudbelguith it's more like a dev report but he's right and it's indeed a bug 👍

Edit: also, it's a regression

@kpodemski kpodemski added the PR available Solution: issue is being addressed label Sep 3, 2021
@khouloudbelguith
Copy link
Contributor

Thanks @kpodemski, I updated the first comment.
It is a regression from PS1776.

I’ll add this to the debug roadmap.

Thanks!

@khouloudbelguith khouloudbelguith added 1.7.7.6 Affects versions Major Severity: major bug > https://build.prestashop.com/news/severity-classification Performance Label: Which BO under menu is concerned Ready Status: Issue is ready to be worked on and removed NMI Status: issue needs more information 1.7.7.7 Affects versions labels Sep 3, 2021
@khouloudbelguith khouloudbelguith changed the title Undefined index: attribute_price in Product.php BO - Products page - an exception is displayed when combination feature is disabled Sep 3, 2021
@khouloudbelguith khouloudbelguith added the Regression Type: regression label Sep 3, 2021
@khouloudbelguith khouloudbelguith linked a pull request Sep 3, 2021 that will close this issue
@MatShir MatShir added this to In progress in PrestaShop 1.7.7.8 Sep 6, 2021
@MatShir MatShir moved this from In progress to To be tested in PrestaShop 1.7.7.8 Sep 6, 2021
@Progi1984 Progi1984 added this to the 1.7.7.8 milestone Sep 6, 2021
@khouloudbelguith khouloudbelguith added Fixed Resolution: issue closed because fixed and removed Ready Status: Issue is ready to be worked on labels Sep 8, 2021
@matks
Copy link
Contributor

matks commented Sep 8, 2021

Fixed by #25784

@matks matks closed this as completed Sep 8, 2021
@matks matks moved this from To be tested to Done in PrestaShop 1.7.7.8 Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.7.6 Affects versions BO Category: Back Office Bug Type: Bug Combinations Product type: issue about products with combinations Fixed Resolution: issue closed because fixed Major Severity: major bug > https://build.prestashop.com/news/severity-classification Old Products Page Concerns the old product page Performance Label: Which BO under menu is concerned PR available Solution: issue is being addressed Regression Type: regression
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants