Page MenuHomePhabricator

D17576.id.diff
No OneTemporary

D17576.id.diff

diff --git a/src/infrastructure/cluster/config/PhabricatorClusterSearchConfigOptionType.php b/src/infrastructure/cluster/config/PhabricatorClusterSearchConfigOptionType.php
--- a/src/infrastructure/cluster/config/PhabricatorClusterSearchConfigOptionType.php
+++ b/src/infrastructure/cluster/config/PhabricatorClusterSearchConfigOptionType.php
@@ -4,7 +4,7 @@
extends PhabricatorConfigJSONOptionType {
public function validateOption(PhabricatorConfigOption $option, $value) {
- self::validateClusterSearchConfigValue($value);
+ self::validateValue($value);
}
public static function validateValue($value) {
diff --git a/src/infrastructure/cluster/search/PhabricatorSearchService.php b/src/infrastructure/cluster/search/PhabricatorSearchService.php
--- a/src/infrastructure/cluster/search/PhabricatorSearchService.php
+++ b/src/infrastructure/cluster/search/PhabricatorSearchService.php
@@ -186,6 +186,18 @@
$refs = array();
foreach ($services as $config) {
+
+ // Normally, we've validated configuration before we get this far, but
+ // make sure we don't fatal if we end up here with a bogus configuration.
+ if (!isset($engines[$config['type']])) {
+ throw new Exception(
+ pht(
+ 'Configured search engine type "%s" is unknown. Valid engines '.
+ 'are: %s.',
+ $config['type'],
+ implode(', ', array_keys($engines))));
+ }
+
$engine = $engines[$config['type']];
$cluster = new self($engine);
$cluster->setConfig($config);

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 9:50 AM (5 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7706789
Default Alt Text
D17576.id.diff (1 KB)

Event Timeline