[wp-trac] [WordPress Trac] #56926: Infinite loop in wp_nav_menu

WordPress Trac noreply at wordpress.org
Wed Nov 16 19:50:55 UTC 2022


#56926: Infinite loop in wp_nav_menu
-------------------------------------------------+-------------------------
 Reporter:  david.binda                          |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.1.2
Component:  Menus                                |     Version:  6.1
 Severity:  normal                               |  Resolution:
 Keywords:  reporter-feedback has-patch has-     |     Focuses:
  unit-tests needs-refresh                       |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * owner:  (none) => hellofromTonya
 * status:  new => assigned


Comment:

 I'm self-assigning ownership. My plan:

 * Do a deep dive into the code changes to better understand what changed
 and why.
 * Then look at the deeper nested menu relationship concerns.
 * Then assess what might go wrong with `while()` loop and potentially how
 to guard it. (add more test datasets)
 * If multiple things could go wrong, consider a different approach.

 Some initial thoughts:
 * Should a notice be thrown instead of silently exiting the loop? Why? To
 avoid silently bypassing the logic without knowing why it's being
 bypassed. Why? The behavior is not expected. Alerting the developers or
 support folks can help with fixing the menu-to-[grand]parent ID issue.
 * Besides the menu item ID === its parent's ID, could it also impact when
 its a grandparent or higher up the tree?
 * What other side effects or unexpected behaviors when a menu item's ID is
 the same as its parent|grandparent|etc?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56926#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list