Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#12949 closed defect (bug) (fixed)

Nav Menu throws a fatal error for invalid taxonomies

Reported by: ptahdunbar's profile ptahdunbar Owned by: ryan's profile 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 13 years ago.
nav_menu_term_url_bug.diff (619 bytes) - added by ptahdunbar 13 years ago.

Download all attachments as: .zip

Change History (6)

#1 @nacin
13 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.

#2 @nacin
13 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.

#3 @ptahdunbar
13 years ago

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

#4 @ryan
13 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.