Skip to content

Commit

Permalink
Fix: Search issues using Client::SEARCH_SCOPE_ALL with null being ret…
Browse files Browse the repository at this point in the history
…urned instead of actual results
  • Loading branch information
jamesfairhurst committed Mar 7, 2016
1 parent 4ac5744 commit b90486c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Evernote/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1118,15 +1118,14 @@ protected function findNotes_findInLinkedScopeWithContext($context)
}
}

$this->findNotes_nextFindInLinkedScopeWithContext($context);
return $this->findNotes_nextFindInLinkedScopeWithContext($context);
}

protected function findNotes_nextFindInLinkedScopeWithContext($context)
{

if (count($context->linkedNotebooksToSearch) == 0) {
$this->findNotes_processResultsWithContext($context);
return;
return $this->findNotes_processResultsWithContext($context);
}

// Pull the first notebook off the list of pending linked notebooks.
Expand All @@ -1148,9 +1147,9 @@ protected function findNotes_nextFindInLinkedScopeWithContext($context)
$context->findMetadataResults[] = $notesMetadata;
}

$this->findNotes_nextFindInLinkedScopeWithContext($context);
// $this->findNotes_nextFindInLinkedScopeWithContext($context);

$this->findNotes_processResultsWithContext($context);
return $this->findNotes_processResultsWithContext($context);
}

protected function compareByTitle($obj1, $obj2)
Expand All @@ -1173,11 +1172,11 @@ protected function findNotes_processResultsWithContext($context)
// OK, now we have a complete list of note refs objects. If we need to do a local sort, then do so.
if ($context->requiresLocalMerge) {
if ($this->isFlagSet($context->sortOrder, self::SORT_ORDER_RECENTLY_CREATED)) {
return usort($context->findMetadataResults, array($this, 'compareByCreated'));
usort($context->findMetadataResults, array($this, 'compareByCreated'));
} elseif ($this->isFlagSet($context->sortOrder, self::SORT_ORDER_RECENTLY_UPDATED)) {
return usort($context->findMetadataResults, array($this, 'compareByUpdated'));
usort($context->findMetadataResults, array($this, 'compareByUpdated'));
} else {
return usort($context->findMetadataResults, array($this, 'compareByTitle'));
usort($context->findMetadataResults, array($this, 'compareByTitle'));
}
}

Expand Down

0 comments on commit b90486c

Please sign in to comment.