[wp-trac] [WordPress Trac] #57333: Having a huge/really large menu i get: Warning: Undefined array key in C:\xampp\htdocs\wp-includes\nav-menu-template.php

WordPress Trac noreply at wordpress.org
Thu Dec 15 13:18:30 UTC 2022


#57333: Having a huge/really large menu i get: Warning: Undefined array key in
C:\xampp\htdocs\wp-includes\nav-menu-template.php
--------------------------+-----------------------------
 Reporter:  mobilebsmith  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Would get the warnings below, and menu wouldn't show. Changing the code
 shown here (I left the original in, just commented out. fixed the issue.

 ------nav-menu-template.php------
         // Calculate the depth of each menu item with children.
         foreach ( $menu_items_with_children as $menu_item_key =>
 &$menu_item_depth ) {
                 //$menu_item_parent = $menu_items_tree[ $menu_item_key ];
                 $menu_item_parent = isset($menu_items_tree[ $menu_item_key
 ]) ? $menu_items_tree[ $menu_item_key ] : null ;
                 while ( $menu_item_parent ) {
                         $menu_item_depth  = $menu_item_depth + 1;
                         //$menu_item_parent = $menu_items_tree[
 $menu_item_parent ];
                         $menu_item_parent = isset($menu_items_tree[
 $menu_item_parent ]) ? $menu_items_tree[ $menu_item_parent ] : null ;
                 }
         }

 ---------

 Warning: Undefined array key 21700 in C:\xampp\htdocs\wp-includes\nav-
 menu-template.php on line 211

 Warning: Undefined array key 21700 in C:\xampp\htdocs\wp-includes\nav-
 menu-template.php on line 215

 Warning: Undefined array key 21700 in C:\xampp\htdocs\wp-includes\nav-
 menu-template.php on line 215

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57333>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list