Skip to content

Commit

Permalink
Bug: 14155 Fix searching in VBooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Nov 7, 2015
1 parent a8c83f9 commit 644ae49
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions turba/lib/Driver/Vbook.php
Expand Up @@ -85,8 +85,17 @@ protected function _search(array $criteria, array $fields, array $blobFields = a
/* Add the passed in search criteria to the vbook criteria
* (which need to be mapped from turba fields to
* driver-specific fields). */
$criteria['AND'][] = $this->makeSearch($this->searchCriteria, 'AND', array());
$results = $this->_driver->_search($criteria, $fields, $blobFields);
$new_criteria = array();
if (empty($criteria['AND'])) {
$new_criteria['AND'] = array(
$criteria,
$this->makeSearch($this->searchCriteria, 'AND', array())
);
} else {
$new_criteria = $criteria;
$new_criteria['AND'][] = $this->makeSearch($this->searchCriteria, 'AND', array());
}
$results = $this->_driver->_search($new_criteria, $fields, $blobFields);
return $count_only ? count($results) : $results;
}

Expand Down

0 comments on commit 644ae49

Please sign in to comment.