Page MenuHomePhorge

D25554.1734641188.diff
No OneTemporary

D25554.1734641188.diff

diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php
@@ -48,15 +48,28 @@
return $request->getStr($this->getFieldKey());
}
+ /**
+ * Apply an application search constraint to a query.
+ * If you have a field of type integer, and a value (or an array of values),
+ * the result set will be limited to the rows with these values.
+ * @param PhabricatorApplicationSearchEngine $engine
+ * @param PhabricatorCursorPagedPolicyAwareQuery $query
+ * @param mixed $value Single value or array of values (IN query).
+ */
public function applyApplicationSearchConstraintToQuery(
PhabricatorApplicationSearchEngine $engine,
PhabricatorCursorPagedPolicyAwareQuery $query,
$value) {
- if (phutil_nonempty_scalar($value)) {
- $query->withApplicationSearchContainsConstraint(
- $this->newNumericIndex(null),
- $value);
+ // The basic use case is with a single value.
+ // The backend really works with an array. So also array allowed.
+ if (is_array($value) || phutil_nonempty_scalar($value)) {
+ $value = (array)$value;
+ if ($value) {
+ $query->withApplicationSearchContainsConstraint(
+ $this->newNumericIndex(null),
+ $value);
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 20:46 (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1015562
Default Alt Text
D25554.1734641188.diff (1 KB)

Event Timeline