Make WordPress Core

Opened 2 years ago

Closed 23 months ago

#26634 closed defect (bug) (fixed)

get_queried_object does not test anymore for existence of terms in tax_query

Reported by: Chouby Owned by:
Milestone: 3.8.1 Priority: normal
Severity: normal Version: 3.8
Component: Query Keywords: has-patch fixed-major
Focuses: Cc:


This may result in PHP errors:

PHP Warning:  reset() expects parameter 1 to be array, null given in /wp-includes/query.php on line 3277
PHP Notice:  Undefined index: taxonomy in /wp-includes/query.php on line 3277

This appears to be a regression introduced in WP 3.8 by [26007] for #20767.

Attachments (1)

26634.patch (465 bytes) - added by Chouby 2 years ago.

Download all attachments as: .zip

Change History (12)

2 years ago

#1 @Chouby
2 years ago

  • Keywords has-patch added

#2 @wonderboymusic
2 years ago

  • Keywords has-patch removed

I believe you, but what query caused this? I would like to add another unit test for it

#3 @wonderboymusic
2 years ago

  • Keywords has-patch added

#4 @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 3.8.1

#5 @Chouby
2 years ago

@wonderboymusic I remove a custom taxonomy from the query in a parse_query filter

add_filter('parse_query', 'remove_my_tax');
function remove_my_tax($query) {
	$qvars = &$query->query_vars;
	unset ($qvars['my-tax']); // 'my-tax' is a custom taxonomy query var

#6 @wonderboymusic
2 years ago

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

Fixed in [26864].

#7 @nacin
2 years ago

  • Keywords fixed-major added

Re-opening to be code-reviewed and considered for inclusion in 3.8.1.

#8 @SergeyBiryukov
2 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#9 @layotte
2 years ago

Submitted patch here #26728 which fixes bug in [26864]

Last edited 2 years ago by SergeyBiryukov (previous) (diff)

#10 @SergeyBiryukov
2 years ago

[26874] fixes the bug in [26864].

#11 @nacin
23 months ago

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

[26946] for 3.8.1.

Note: See TracTickets for help on using tickets.