Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Unset alt in the return json if it was empty as it was causing the js…

… to render undefined as an additonal option for those records.
  • Loading branch information...
commit facc708a119638c36431f5fcbb14bdcfd65bba38 1 parent 857e273
@nigelgbanks nigelgbanks authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 islandora_authority.module
View
8 islandora_authority.module
@@ -183,7 +183,9 @@ function _build_match(&$results, &$solr_doc, &$field_info) {
$toReturn['alts'][$index - 1] = $toMerge;
}
}
-
+ if (empty($toReturn['alts'])) {
+ unset($toReturn['alts']);
+ }
return $toReturn;
}
@@ -246,8 +248,8 @@ function islandora_authority_autocomplete($build_id, $element, $string = '') {
'qf' => $fields['fields'][$element]['search_field_name'],
'fl' => implode(',', (array) $fields['fl']),
'fq' => implode(' ', $fields['fq']),
- 'defType' => 'dismax'
- ));
+ 'defType' => 'dismax')
+ );
$matches = array();
if (isset($results)) {
foreach ($results->response->docs as &$doc) {
Please sign in to comment.
Something went wrong with that request. Please try again.