WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 3 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:

Description

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 4 months ago.

Download all attachments as: .zip

Change History (12)

Chouby4 months ago

comment:1 Chouby4 months ago

  • Keywords has-patch added

comment:2 wonderboymusic4 months ago

  • Keywords has-patch removed

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

comment:3 wonderboymusic4 months ago

  • Keywords has-patch added

comment:4 SergeyBiryukov4 months ago

  • Milestone changed from Awaiting Review to 3.8.1

comment:5 Chouby4 months 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
}

comment:6 wonderboymusic4 months ago

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

Fixed in [26864].

comment:7 nacin4 months ago

  • Keywords fixed-major added

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

comment:8 SergeyBiryukov4 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:9 layotte4 months ago

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

Last edited 4 months ago by SergeyBiryukov (previous) (diff)

comment:11 nacin3 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.