Page MenuHomePhabricator

Allow filtering of "date" custom fields
ClosedPublic

Authored by epriestley on Mar 23 2014, 6:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 4:03 PM
Unknown Object (File)
Fri, Dec 20, 4:46 PM
Unknown Object (File)
Fri, Dec 20, 10:23 AM
Unknown Object (File)
Thu, Dec 12, 1:16 AM
Unknown Object (File)
Wed, Dec 4, 12:47 PM
Unknown Object (File)
Wed, Dec 4, 12:44 PM
Unknown Object (File)
Wed, Dec 4, 12:42 PM
Unknown Object (File)
Wed, Dec 4, 12:41 PM

Details

Summary

Ref T4663. Ref T4659. Allows "date" fields to be filtered with range parameters.

Test Plan
  • Added a custom "date" field with "search".
  • Populated some values.
  • Searched for dates using new range filters.
  • Combined date search with other searches.
  • Ran other searches independently.
  • Inspected the generated queries.

Diff Detail

Repository
rP Phabricator
Branch
dsearch1
Lint
Lint Passed
Unit
Tests Passed

Event Timeline

epriestley retitled this revision from to Allow filtering of "date" custom fields.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.

Does this also implicitly enable sorting?

Okay. I'll try patching it in the next day or two, if it isn't landed by then.

After patching this and attempting to run a query against my custom "due date" field, I got this error:

Argument 2 passed to PhabricatorTime::parseLocalTime() must be an instance of PhabricatorUser, null given, called in /Checkout/facebook/phabricator/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php on line 116 and defined

For reference, my query attempted to use "Before Due Date" with a value of "4-1-2014".

It appears as if I was not logged in while running the query, but I was definitely logged in (my instance does not allow anonymous access).

Attempting to patch on top of D8595 gives me an empty commit error. Not sure what is going on there...

Doh, forgot that adding dependencies to diffs automatically handles the diffs. Patch works fine now, but the filters don't appear to work:

Screenshot_2014-03-23_14.04.57.png (227×348 px, 21 KB)

Screenshot_2014-03-23_14.05.05.png (231×332 px, 21 KB)

Screenshot_2014-03-23_14.05.57.png (1×873 px, 100 KB)

Nevermind, it looks like that is just crappy parsing of the date by the filter... If I use a more verbose date, it works properly:

Screenshot_2014-03-23_14.07.53.png (353×247 px, 17 KB)

btrahan edited edge metadata.
btrahan added inline comments.
src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
534

s/contraint/constraint

This revision is now accepted and ready to land.Mar 25 2014, 8:09 PM
epriestley updated this revision to Diff 20425.

Closed by commit rP8e8818783599 (authored by @epriestley).

Is that search/group by custom fields works in latest release from this week?
I'm in need of that but can't see any custom field (added in Maniphest) in search query task interface.
Thanks for answers