Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#55111 closed defect (bug) (duplicate)

Notice: Trying to get property 'title' of non-object

Reported by: suresh-shinde's profile Suresh Shinde Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Customize Keywords:
Focuses: Cc:

Description

Got notice in Customizer as;

Notice: Trying to get property 'title' of non-object in \wp-includes\class-wp-customize-nav-menus.php on line 523

WordPress setup details as;
THEME: Twenty Twenty-Two – 1.0
WordPress 5.9.1-alpha-52683
PHP 7.4
Imported WP unit testing data of xml file

Change History (2)

#1 @dlh
2 years ago

  • Keywords needs-patch added; has-dev-note removed
  • Milestone changed from Awaiting Review to 5.9.1

Hi @suresh-shinde, and welcome to WordPress Trac! Thanks for the ticket.

I think this was introduced in [52621], so marking for 5.9.1 consideration.

The Customizer seems to assume that it will be known whether nav menus are going to be available by this point: https://github.com/WordPress/wordpress-develop/blob/4bf908449ad3be738e893d35faa449293d3ccb19/src/wp-includes/class-wp-customize-nav-menus.php#L55-L57

However, since the referenced commit short-circuits the nav menus panel via check_capabilities(), the panel is removed from the manager at a later stage -- the customize_controls_init hook: https://github.com/WordPress/wordpress-develop/blob/8db1549c0f1af05fbb919ad2eeb7f7bff5a63da9/src/wp-includes/class-wp-customize-manager.php#L4471-L4487

#2 @SergeyBiryukov
2 years ago

  • Keywords needs-patch removed
  • Milestone 5.9.1 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #54905.

Note: See TracTickets for help on using tickets.