Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/herald/typeahead/HeraldRuleDatasource.php b/src/applications/herald/typeahead/HeraldRuleDatasource.php
index 88343bd433..6b73bc0ab6 100644
--- a/src/applications/herald/typeahead/HeraldRuleDatasource.php
+++ b/src/applications/herald/typeahead/HeraldRuleDatasource.php
@@ -1,57 +1,57 @@
<?php
final class HeraldRuleDatasource
extends PhabricatorTypeaheadDatasource {
public function getPlaceholderText() {
return pht('Type a Herald rule name...');
}
public function getBrowseTitle() {
return pht('Browse Herald Rules');
}
public function getDatasourceApplicationClass() {
return 'PhabricatorHeraldApplication';
}
public function loadResults() {
$viewer = $this->getViewer();
$raw_query = $this->getRawQuery();
$query = id(new HeraldRuleQuery())
->setViewer($viewer);
- if (preg_match('/^[hH]\d+\z/', $raw_query)) {
+ if (($raw_query !== null) && preg_match('/^[hH]\d+\z/', $raw_query)) {
$id = trim($raw_query, 'hH');
$id = (int)$id;
$query->withIDs(array($id));
} else {
$query->withDatasourceQuery($raw_query);
}
$rules = $query->execute();
$handles = id(new PhabricatorHandleQuery())
->setViewer($viewer)
->withPHIDs(mpull($rules, 'getPHID'))
->execute();
$results = array();
foreach ($rules as $rule) {
$handle = $handles[$rule->getPHID()];
$result = id(new PhabricatorTypeaheadResult())
->setName($handle->getFullName())
->setPHID($handle->getPHID());
if ($rule->getIsDisabled()) {
$result->setClosed(pht('Archived'));
}
$results[] = $result;
}
return $results;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Aug 15, 12:29 AM (3 d, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
198028
Default Alt Text
(1 KB)

Event Timeline