Make WordPress Core

Opened 15 years ago

Closed 13 years ago

#20376 closed defect (bug) (fixed)

wp_list_pages fails with meta_value=0 criteria

Reported by: Big Tick Owned by: SergeyBiryukov
Priority: normal Milestone: 3.6
Component: Query Version: 3.3.1
Severity: normal Keywords: has-patch commit
Cc: Focuses:

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 15 years ago.
20376.2.patch​ (877 bytes ) - added by SergeyBiryukov 14 years ago.
20376.3.patch​ (741 bytes ) - added by kovshenin 14 years ago.
20376.tests.diff​ (1.3 KB ) - added by kovshenin 14 years ago.
20376.4.patch​ (868 bytes ) - added by DrewAPicture 13 years ago.
Refresh.

Download all attachments as: .zip

Change History (21)

#1 @SergeyBiryukov
15 years ago

  • Keywords has-patch added; needs-patch removed

Related: #15292

#2 @wonderboymusic
14 years ago

  • Milestone Awaiting Review → 3.5

#3 @nacin
14 years ago

  • Owner set to nacin
  • Resolution → fixed
  • Status new → closed

In 22445:

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

#4 @nacin
14 years ago

In 22464:

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

#5 @nacin
14 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone 3.5 → Future Release
  • Resolution fixed
  • Status closed → reopened

See #22389.

#6 @nacin
14 years ago

  • Owner nacin removed
  • Status reopened → assigned

#7 @SergeyBiryukov
14 years ago

  • Keywords has-patch added; needs-patch removed

#8 @rmccue
14 years ago

  • Keywords commit added

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

#9 @knutsp
14 years ago

  • Cc knut@… added

#10 @SergeyBiryukov
14 years ago

  • Milestone Future Release → 3.6

#11 @SergeyBiryukov
14 years ago

  • Keywords needs-unit-tests added

@kovshenin
14 years ago

#12 @kovshenin
14 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
13 years ago

Refresh.

#14 @SergeyBiryukov
13 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
13 years ago

  • Keywords needs-unit-tests removed

#16 @SergeyBiryukov
13 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status assigned → closed

In 24238:

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

Note: See TracTickets for help on using tickets.