WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6666 closed defect (bug) (duplicate)

wp_get_object_terms throws a notice in WP_DEBUG mode

Reported by: simonwheatley Owned by: westi
Milestone: Priority: normal
Severity: normal Version: 2.5
Component: General Keywords:
Focuses: Cc:

Description

Steps to reproduce:

  1. Define the constant WP_DEBUG in wp_config.php
  1. Browse to the blog homepage of a fairly vanilla WP2.5 install
  1. Check the PHP error log, and you should see:

Notice: Undefined index: path in /Users/simon/Projects/WordPress-2.5/site/wp-includes/canonical.php:174

I suggest that $t->args is tested with isset at the beginning of the IF statement (see attached patch, test_for_args.patch). Someone with greater knowledge of that functionality might be able to suggest replacing the is_array test with isset...

Attachments (1)

test_for_args.patch (601 bytes) - added by simonwheatley 7 years ago.
Patched taxonomy.php to test for $t-args in an IF statement

Download all attachments as: .zip

Change History (6)

@simonwheatley7 years ago

Patched taxonomy.php to test for $t-args in an IF statement

comment:1 @simonwheatley7 years ago

  • Cc simon@… added

comment:2 @westi7 years ago

  • Milestone changed from 2.5.1 to 2.6
  • Owner changed from anonymous to westi
  • Status changed from new to assigned
  • Version set to 2.5

2.6 is a more appropriate target for these fixes.

comment:3 @kaspars4047 years ago

Note: Title and patch is duplicate of ticket:6960. Look only at the description for this "E_NOTICE" bug.

comment:4 @jacobsantos7 years ago

  • Milestone 2.9 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

This most likely was fixed with another notices patch. I think there should only be one ticket for notices and warnings fixes per WordPress version.

comment:5 @jacobsantos7 years ago

  • Keywords has-patch needs-testing removed
Note: See TracTickets for help on using tickets.