Skip to content

Commit

Permalink
Fix defaulting to default 'search' fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Oct 7, 2014
1 parent fa8feba commit e18ea0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions turba/lib/Api.php
Expand Up @@ -1163,6 +1163,9 @@ public function search($names = null, array $opts = array())
continue;
}

if (empty($opts['fields'][$source])) {
$opts['fields'][$source] = $GLOBALS['cfgSources'][$source]['search'];
}
$sdriver = $driver->create($source);

foreach ($names as $name) {
Expand All @@ -1176,9 +1179,6 @@ public function search($names = null, array $opts = array())
$criteria[$field] = $trimname;
}
}
if (!count($criteria)) {
$criteria = $cfgSources[$source]['search'];
}
}

try {
Expand Down

0 comments on commit e18ea0c

Please sign in to comment.