[wp-trac] [WordPress Trac] #19642: Toolbar shows a warning on a second call

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 21 22:34:32 UTC 2011


#19642: Toolbar shows a warning on a second call
----------------------------+-----------------------
 Reporter:  SergeyBiryukov  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  3.3.1
Component:  Toolbar         |    Version:  3.3
 Severity:  normal          |   Keywords:  has-patch
----------------------------+-----------------------
 Slight regression from 3.2.

 After upgrading to 3.3, some people saw the warning near the Toolbar:
 {{{
 Notice: Trying to get property of non-object in wp-includes/class-wp-
 admin-bar.php on line 342
 Warning: Invalid argument supplied for foreach() in wp-includes/class-wp-
 admin-bar.php on line 342
 }}}

 * http://wordpress.org/support/topic/receiving-an-invalid-argument-error-
 on-homepage
 * http://wordpress.org/support/topic/no-admin-toolbar-on-website-page-
 after-upgrade-to-33
 * http://wordpress.org/support/topic/admin-bar-not-loading-blog-page-not-
 admin-side
 * http://wordpress.org/support/topic/message-appears-across-top-of-site

 This happens if a theme has two `wp_footer()` calls, or both
 `do_action('wp_footer')` and `wp_footer()` (which of course is wrong and
 weird, but didn't produce a warning in 3.2).

 The problem is that `$wp_admin_bar->render()` doesn't check the result of
 `_bind()` (which returns nothing on a second call) before calling
 `_render()`:[[BR]]
 http://core.trac.wordpress.org/browser/tags/3.3/wp-includes/class-wp-
 admin-bar.php#L197

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19642>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list