Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#20376 closed defect (bug) (fixed)

wp_list_pages fails with meta_value=0 criteria

Reported by: big-tick's profile Big Tick Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.3.1
Component: Query Keywords: has-patch commit
Focuses: Cc:

Description

The following code will ignore the meta_key filtering. In other words, wp_list_pages can't test for a meta_value of 0.

wp_list_pages(
  array(
    'meta_key' => 'a_custom_key',
    'meta_value' => '0'
  )
)

Attachments (5)

20376.patch (843 bytes) - added by SergeyBiryukov 13 years ago.
20376.2.patch (877 bytes) - added by SergeyBiryukov 12 years ago.
20376.3.patch (741 bytes) - added by kovshenin 12 years ago.
20376.tests.diff (1.3 KB) - added by kovshenin 12 years ago.
20376.4.patch (868 bytes) - added by DrewAPicture 12 years ago.
Refresh.

Download all attachments as: .zip

Change History (21)

#1 @SergeyBiryukov
13 years ago

  • Keywords has-patch added; needs-patch removed

Related: #15292

#2 @wonderboymusic
12 years ago

  • Milestone changed from Awaiting Review to 3.5

#3 @nacin
12 years ago

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

In 22445:

Fix meta value querying in wp_list_pages(). props SergeyBiryukov. fixes #20376.

#4 @nacin
12 years ago

In 22464:

Revert [22445]. see #20376. fixes #22389.

#5 @nacin
12 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 3.5 to Future Release
  • Resolution fixed deleted
  • Status changed from closed to reopened

See #22389.

#6 @nacin
12 years ago

  • Owner nacin deleted
  • Status changed from reopened to assigned

#7 @SergeyBiryukov
12 years ago

  • Keywords has-patch added; needs-patch removed

#8 @rmccue
12 years ago

  • Keywords commit added

No regression on wp_dropdown_pages(), looks good to me.

#9 @knutsp
12 years ago

  • Cc knut@… added

#10 @SergeyBiryukov
12 years ago

  • Milestone changed from Future Release to 3.6

#11 @SergeyBiryukov
12 years ago

  • Keywords needs-unit-tests added

@kovshenin
12 years ago

#12 @kovshenin
12 years ago

Refreshed 20376.3.patch and added unit tests for meta queries in get_pages and wp_dropdown_pages in 20376.tests.diff.

@DrewAPicture
12 years ago

Refresh.

#14 @SergeyBiryukov
12 years ago

In 1279/tests:

get_pages() test for '0' as meta_value argument and a basic wp_dropdown_pages() test. props kovshenin. see #20376.

#15 @SergeyBiryukov
12 years ago

  • Keywords needs-unit-tests removed

#16 @SergeyBiryukov
12 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from assigned to closed

In 24238:

Fix handling of '0' as meta_value argument in get_pages(). fixes #20376.

Note: See TracTickets for help on using tickets.