Opened 3 years ago
Closed 3 years ago
#55111 closed defect (bug) (duplicate)
Notice: Trying to get property 'title' of non-object
Reported by: |
|
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)
Note: See
TracTickets for help on using
tickets.
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 -- thecustomize_controls_init
hook: https://github.com/WordPress/wordpress-develop/blob/8db1549c0f1af05fbb919ad2eeb7f7bff5a63da9/src/wp-includes/class-wp-customize-manager.php#L4471-L4487