Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#27283 closed enhancement (fixed)

WP_Date_Query missing column user_registered

Reported by: chrico's profile ChriCo Owned by: boonebgorges's profile boonebgorges
Milestone: 4.1 Priority: normal
Severity: normal Version: 3.8
Component: Query Keywords: has-patch commit needs-docs
Focuses: Cc:

Description

In WP_Date_Query-Class theres a missing column "user_registered" and no support for it in WP_User_Query.

We've to add the missing Column in WP_Date_Query-Class on Method validate_column and add the query_var on WP_User-Query-Class.

Attachments (2)

#27283.patch (3.6 KB) - added by ChriCo 11 years ago.
Added patch with unit-tests
27283.diff (3.0 KB) - added by nacin 10 years ago.

Download all attachments as: .zip

Change History (12)

@ChriCo
11 years ago

Added patch with unit-tests

#1 @SergeyBiryukov
11 years ago

  • Component changed from Date/Time to Query
  • Version changed from trunk to 3.8

#2 @wonderboymusic
11 years ago

  • Keywords has-patch needs-refresh added
  • Milestone changed from Awaiting Review to 4.0

I like where this is going

This ticket was mentioned in IRC in #wordpress-dev by helen. View the logs.


10 years ago

@nacin
10 years ago

#4 @nacin
10 years ago

  • Keywords commit needs-unit-tests added; needs-refresh removed
  • Milestone changed from 4.0 to Future Release

I uploaded a cleaned up patch. Looking at the tests, though, it doesn't look like there are any functional assertions here. It's simply comparing that the SQL output of a WP_Date_Query instance is returning the same WHERE as the WP_Date_Query instance inside WP_User_Query. That's insufficient as they could all be returning nothing and the whole thing would pass.

We need to essentially borrow Tests_Comment_DateQuery or Tests_Query_DateQuery and make our own Tests_User_DateQuery in tests/phpunit/user/datequery.php.

Moving out of 4.0, though this is simple enough we can bring it back in if tests are written.

#5 @SergeyBiryukov
10 years ago

#29600 was marked as a duplicate.

#6 @boonebgorges
10 years ago

  • Keywords needs-unit-tests removed
  • Milestone changed from Future Release to 4.1
  • Owner set to boonebgorges
  • Status changed from new to accepted

I got this.

#7 @boonebgorges
10 years ago

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

In 29934:

Support date_query by user_registered in WP_User_Query.

Props ChriCo, nacin.
Fixes #27283.

#8 follow-up: @DrewAPicture
10 years ago

  • Keywords needs-docs added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Let's add a line to the filter changelog about the new column added to the array, please :-)

#9 in reply to: ↑ 8 @boonebgorges
10 years ago

Replying to DrewAPicture:

Let's add a line to the filter changelog about the new column added to the array, please :-)

Oh, you.

#10 @boonebgorges
10 years ago

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

In 29938:

Add @since annotation for 'user_registered' support in 'date_query_valid_columns' documentation.

Props DrewAPicture.
Fixes #27283.

Note: See TracTickets for help on using tickets.