Skip to content

Module-Theme: TopMenu invalid type of value returned #24251

@Krielkip

Description

@Krielkip

#22849 # Preconditions (*)

  1. master 2.3-dev

Steps to reproduce (*)

  1. Code Review, because of error in our stage.

Expected result (*)

  1. Continue with code

Actual result (*)

  1. PHP Error
2019/08/23 06:55:05 [error] 13943#13943: *579 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Argument 4 passed to Magento\Theme\Block\Html\Topmenu::_getHtml() must be of the type array, null given, called in vendor/magento/module-theme/Block/Html/Topmenu.php on line 186 and defined in vendor/magento/module-theme/Block/Html/Topmenu.php:204
Stack trace:
#0 vendor/magento/module-theme/Block/Html/Topmenu.php(186): Magento\Theme\Block\Html\Topmenu->_getHtml(Object(Magento\Framework\Data\Tree\Node), 'submenu', 6, NULL)
#1 vendor/magento/module-theme/Block/Html/Topmenu.php(258): Magento\Theme\Block\Html\Topmenu->_addSubMenu(Object(Magento\Framework\Data\Tree\Node), 0, 'submenu', 6)
#2 vendor/magento/module-theme/Bl" while reading response header from upstream, client: 172.28.128.1, server: *.hypernode.local, request: "GET / HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "magento2.hypernode.local"

Also added an fix pull request; Which will be linked to this issue.

The issue is that in the topmenu building a submenu, it goes to an function which builds an array of _columnBrake.
Only if $total <= $limit then the return is void; aka null. The _getHtml needs an Array, but gets Null; This results in fatal error.

Metadata

Metadata

Assignees

Labels

Fixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions