Page MenuHomePhabricator

Allow filtering of "date" custom fields
ClosedPublic

Authored by epriestley on Mar 23 2014, 6:36 AM.

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
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

epriestley updated this revision to Diff 20386.Mar 23 2014, 6:36 AM
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.
epriestley updated this revision to Diff 20387.Mar 23 2014, 6:44 AM
  • "build build" -> "build"

Does this also implicitly enable sorting?

No, this is filtering only.

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).

Oh -- apply D8595 first.

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:

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:

btrahan accepted this revision.Mar 25 2014, 8:09 PM
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 20408.Mar 25 2014, 8:28 PM
epriestley edited edge metadata.
  • Typo fix.
epriestley closed this revision.Mar 25 2014, 9:21 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