Closed
Description
Preconditions (*)
- Version 2.4.1 and previous releases with support for php 7.4
- Environment should use php >= 7.4
Steps to reproduce (*)
- Invoke the \Magento\Catalog\Block\Product\ListProduct::initializeProductCollection function on a product page with a product with categories
- Following line will be executed: $this->setCategoryId(current($categories->getIterator())->getId());
Expected result (*)
- I expect the id from the first category from the product
Actual result (*)
- Error is returned because you call getId() on null.
- From php >= 7.4 the current() method is no longer returning the first item from a ArrayIterator and instead returns null
- More informations about this incompatible change can be found on phpdoc ( https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.spl )
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.
- 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
The issue has been fixed in 2.4-develop branchGate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.The issue has been reproduced on latest 2.4-develop branchMajor restrictions or short-term circumventions are required until a fix is available.Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Type
Projects
Status
Done