Skip to content

Commit

Permalink
Fixed integration tests. Allowed autocomplete custom was missing in t…
Browse files Browse the repository at this point in the history
…he test cfg.
  • Loading branch information
milanmajchrak committed Nov 5, 2024
1 parent 1d81001 commit 967734c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dspace-api/src/test/data/dspaceFolder/config/local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,5 @@ webui.supported.locales = en
submit.type-bind.field = dc.type,dc.identifier.citation=>dc.title

autocomplete.custom.separator.solr-subject_ac = \\|\\|\\|
autocomplete.custom.separator.solr-title_ac = \\|\\|\\|
autocomplete.custom.separator.solr-title_ac = \\|\\|\\|
autocomplete.custom.allowed = solr-author_ac,solr-publisher_ac,solr-dataProvider_ac,solr-dctype_ac,solr-subject_ac,solr-handle_title_ac,json_static-iso_langs.json,solr-title_ac
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,16 @@ private boolean isAllowedSearching(String autocompleteCustom) {
String[] allowedAutocompleteCustom = configurationService.getArrayProperty("autocomplete.custom.allowed",
new String[0]);

// Remove `?query` from the autocompleteCustom parameter if it contains this specific query parameter
String normalizedAutocompleteCustom = updateAutocompleteAndQuery(autocompleteCustom, null);

// If the allowedAutocompleteCustom parameter is not defined, return false
if (Objects.isNull(allowedAutocompleteCustom)) {
return false;
}

// Convert the allowedAutocompleteCustom array to a list
List<String> allowedAutocompleteCustomList = Arrays.asList(allowedAutocompleteCustom);
return allowedAutocompleteCustomList.contains(autocompleteCustom);
return allowedAutocompleteCustomList.contains(normalizedAutocompleteCustom);
}
}

0 comments on commit 967734c

Please sign in to comment.