Homestyx hydra
Diffusion hydra 5263d5d59030

Custom integer fields: fix search by array of possible values

Description

Custom integer fields: fix search by array of possible values

Summary:
This minimal changes seems the natural expansion of this search function,
that "seems" designed to only search with a single value, but the backend
is designed to receive an array of possible values.

Look at the same method in PhabricatorStandardCustomFieldLink that already
works also for array inputs.

To get extra confidence look at the method withApplicationSearchContainsConstraint()
that works perfectly with arrays (to be honest it only works with arrays in mind...)

This feature allows to avoid crashes when extension developers tries to run "IN" queries
because for example they try to follow our performance guidelines:

https://we.phorge.it/book/contrib/article/n_plus_one/

Closes T15752

Test Plan:
Have a nice custom integer field, like this one for Maniphest:

{
  "mycompany.estimated-hours": {
    "name": "Estimated Hours",
    "type": "int",
    "caption": "Estimated number of hours this will take.",
    "search": true
  }
}

You can reproduce T15752 before the change. It just works after the change.

Or, just trust your instincts by looking at the same method in PhabricatorStandardCustomFieldLink.

Also, use the "normal" frontend search page. Still works as usual.

Reviewers: O1 Blessed Committers, 20after4

Reviewed By: O1 Blessed Committers, 20after4

Subscribers: tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15752

Differential Revision: https://we.phorge.it/D25554

Details

Provenance
Valerio BozzolanAuthored on Mar 30 2024, 7:14 AM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:48e121c485a2: Config Projects Extra Fields: link to the doc (like User)
Branches
Unknown
Tags
Unknown

Event Timeline