WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 2 years ago

#18526 closed defect (bug) (worksforme)

nav_menu.php in wp-admin\includes Error

Reported by: wpsmith Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: reporter-feedback
Focuses: Cc:

Description

Notice: Trying to get property of non-object

This occurs at line 59, $original_title = $original_object->post_title;

Simply changing this to $original_title = isset( $original_object->post_title ) ? $original_object->post_title : ; resolves it.

Change History (3)

comment:1 in reply to: ↑ description wpsmith3 years ago

Replying to wpsmith:

Notice: Trying to get property of non-object

This occurs at line 59, $original_title = $original_object->post_title;

Simply changing this to

$original_title = isset( $original_object->post_title ) ? $original_object->post_title : '';

resolves it.

The same error appears on nav_menu.php in wp-includes line 568. Same solution will resolve it.

$original_title = isset( $original_object->post_title ) ? $original_object->post_title : '';


comment:2 SergeyBiryukov3 years ago

  • Keywords reporter-feedback added

So get_post() the line before returns null?

I tried to create a page, add it to a menu, then delete it permanently, and still didn't get the error. What are the steps to reproduce it?

comment:3 nacin2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.