WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#12949 closed defect (bug) (fixed)

Nav Menu throws a fatal error for invalid taxonomies

Reported by: ptahdunbar Owned by: ryan
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Menus Keywords: has-patch
Focuses: Cc:

Description

Reported by Ron from wp-testers mailinglist:

When I go to Menus I get the following error:
" Object of class WP_Error could not be converted to string in
\...deleted...\wp-includes\formatting.php
on line 433"

Patch fixes this issue by checking if the terms retrieved by get_terms() is a WP_Error object.

Attachments (2)

menus_fatal_error_bug.diff (569 bytes) - added by ptahdunbar 4 years ago.
nav_menu_term_url_bug.diff (619 bytes) - added by ptahdunbar 4 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 nacin4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14048]) Account for WP_Error from get_terms() in the nav menu tax metabox. fixes #12949, props ptahdunbar.

comment:2 nacin4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

get_term_link() can also return WP_Error. We're then running esc_attr on that, and it's causing the same issue.

comment:3 ptahdunbar4 years ago

nav_menu_term_url_bug.dif returns a blank url if get_term_link() throws a wp_error.

comment:4 ryan4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [14599]) Check for WP_Error. Props ptahdunbar. fixes #12949

Note: See TracTickets for help on using tickets.