Skip to content

php8.5 compat: Add null check for last visited category ID before using it#2

Open
Bashev wants to merge 2 commits into
2.4-developfrom
fix-empty-last-visited-category-php8.5-compat
Open

php8.5 compat: Add null check for last visited category ID before using it#2
Bashev wants to merge 2 commits into
2.4-developfrom
fix-empty-last-visited-category-php8.5-compat

Conversation

@Bashev

@Bashev Bashev commented Jun 23, 2026

Copy link
Copy Markdown
Owner

If trying to open products directly from homepage (for example) "lastVisitedCategoryId" is empty and this through an error in php8.5 because reflects to nullable array key. As a result product not shown, because check canBeShowInCategory and user see 404.

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Install Magento 2.4.9 with php8.5
  2. Add products list/grid/slider on homepage.
  3. Make sure categories are not part of the url structure.
  4. Clear all caches and sessions (if previously browse the store).
  5. Try to open some of the products from the homepage.
    Actual result - 404 page (product in our case) not found.
    Expected result must be - products is correctly opened.

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • [] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • [] All automated tests passed successfully (all builds are green)

@Bashev Bashev self-assigned this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant