[wp-trac] [WordPress Trac] #43625: When there are invalid items in a menu, the customizer enters an infinite loop of refreshing when trying to render wp_nav_menu.

WordPress Trac noreply at wordpress.org
Sat Mar 24 06:54:59 UTC 2018


#43625: When there are invalid items in a menu, the customizer enters an infinite
loop of refreshing when trying to render wp_nav_menu.
----------------------------------------+-----------------------------
 Reporter:  flamboyantpretender         |      Owner:
     Type:  defect (bug)                |     Status:  new
 Priority:  normal                      |  Milestone:  Awaiting Review
Component:  Customize                   |    Version:  4.9.5
 Severity:  normal                      |   Keywords:
  Focuses:  javascript, administration  |
----------------------------------------+-----------------------------
 I had an issue where I echoed certain things on the homepage.

 Strangely enough, removing that part of code fixed it, but adding
 something that would 'echo' things out broke it again.

 Long story short, I decoupled every single thing in my theme and
 discovered that when you call `wp_nav_menu`, like so:

 {{{#!php
 <?php
                             wp_nav_menu( array(
                                 'theme_location'=> 'menu-1',
                                 'menu_id'       => 'primary-menu',
                                 'menu_class'    => 'menu szWeo1-unique-
 menu',
                                 'container'        => 'false'
                             ) );
 }}}

 but there are invalid items ''(removed pages or so, '''I believe''')''
 within that menu, the Customizer enters an infinite refresh loop and it
 tries to re-render that menu, but gets stuck, aborts and repeats.

 '''Replication should be easy''',  simply create an item in the menu that
 corresponds to a page, then delete that page. This should render the item
 within the menu "invalid". I can't exactly say that this will work, but
 please do contribute if you know a way of rendering these items invalid in
 a consistent way.

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


More information about the wp-trac mailing list