Make WordPress Core

Opened 4 years ago

Closed 2 years ago

Last modified 2 years ago

#50796 closed enhancement (reported-upstream)

Call to a member function add_node() on string

Reported by: malthert's profile malthert Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.4.2
Component: Toolbar Keywords:
Focuses: Cc:

Description

when using woocommerce beta tester, we get the following 2 notices in wp core.
core needs handling for this to avoid notices.

Call to a member function add_node() on string
File: /wp-includes/admin-bar.php on line 921
Error URL: /wp-admin/post-new.php?post_type=page
Referrer: /wp-admin/post.php?post=1494&action=edit
Trace:
#0 /wp-includes/class-wp-hook.php (287): wp_admin_bar_comments_menu( $wp_admin_bar = WP_Admin_Bar Object )
#1 /wp-includes/class-wp-hook.php (311): WP_Hook->apply_filters( $value = NULL, $args = Array( [0] => WP_Admin_Bar Object ) )
#2 /wp-includes/plugin.php (544): WP_Hook->do_action( $args = Array( [0] => WP_Admin_Bar Object ) )
#3 /wp-includes/admin-bar.php (97): do_action_ref_array( $tag = admin_bar_menu, $args = Array( [0] => WP_Admin_Bar Object ) )
#4 /wp-includes/class-wp-hook.php (287): wp_admin_bar_render()
#5 /wp-includes/class-wp-hook.php (311): WP_Hook->apply_filters( $value = EMPTY STRING, $args = Array( [0] =>  ) )
#6 /wp-includes/plugin.php (478): WP_Hook->do_action( $args = Array( [0] =>  ) )
#7 /wp-admin/admin-header.php (245): do_action( $tag = in_admin_header )
#8 /wp-admin/edit-form-blocks.php (420): require_once( /wp-admin/admin-header.php )
#9 /wp-admin/post-new.php (72): require( /wp-admin/edit-form-blocks.php )


Warning: wp.data.select( "core/editor" ).getBlocks is deprecated. Please use wp.data.select( "core/block-editor" ).getBlocks instead.
URL: /wp-admin/post-new.php?post_type=page
File: /wp-includes/js/dist/deprecated.min.js?ver=224
Line: 2

Change History (9)

#1 @SergeyBiryukov
4 years ago

  • Component changed from General to Toolbar

This ticket was mentioned in Slack in #core by sabernhardt. View the logs.


4 years ago

#3 @sabernhardt
4 years ago

  • Keywords reporter-feedback 2nd-opinion added
  • Type changed from defect (bug) to enhancement

Another ticket about adding error handling (for a different error) was closed as won't-fix: #51894.

@malthert To move forward with this ticket:

  1. Could you give example code that would create this error?
  2. My idea for fixing involves starting each function that uses $wp_admin_bar with a type check (and maybe ending the function there if it's not an object). Would that work and/or is there a better way?

#5 @malthert
2 years ago

  • Resolution set to reported-upstream
  • Status changed from new to closed

#6 @sabernhardt
2 years ago

@malthert Could you add a link to the upstream report?

#7 @malthert
2 years ago

There were multiple issues actually. It was fixed as of 2.0.2 https://github.com/woocommerce/woocommerce-beta-tester/releases

#8 @sabernhardt
2 years ago

  • Milestone Awaiting Review deleted

OK. Thanks for the update!

#9 @SergeyBiryukov
2 years ago

  • Keywords reporter-feedback 2nd-opinion removed
Note: See TracTickets for help on using tickets.