-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Issue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchCannot reproduce the issue on the latest `2.4-develop` branchIssue: needs updateAdditional information is require, waiting for responseAdditional information is require, waiting for responseReported on 2.4.2Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.
Description
Preconditions (*)
- Magento 2.4.2-p2
Steps to reproduce (*)
- Go to Product Display page with product assigned to at least one category
Expected result (*)
- Product display page is rendered
Actual result (*)
- Error is thrown (developer mode)
Stack trace:
Error: Call to a member function getId() on bool in /var/www/html/vendor/magento/module-catalog/Block/Product/ListProduct.php:464
This appears to be related to the change in the Magento\Catalog\Block\Product\ListProduct
class, converting to the use of the current
method:
462 if ($categories->count()) {
463 // show products from this category
464 $this->setCategoryId(current($categories->getIterator())->getId());
465 }
Converting this to use the built in current()
method in the ArrayIterator
class works as expected:
462 if ($categories->count()) {
463 // show products from this category
464 $this->setCategoryId($categories->getIterator()->current()->getId());
465 }
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [ x] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Issue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchCannot reproduce the issue on the latest `2.4-develop` branchIssue: needs updateAdditional information is require, waiting for responseAdditional information is require, waiting for responseReported on 2.4.2Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.