Skip to content

Commit

Permalink
MID-8141 fix 500 error - user search on employee number
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 4, 2022
1 parent a8b0ac1 commit 7363149
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public Search<C> load() {
Search<C> search = null;
PageStorage storage = getPageStorage();
String searchByName = getSearchByNameParameterValue();
if (storage != null && searchByName == null) { // do NOT use storage when using name search (e.g. from dashboard)
if (storage != null && storage.getSearch() != null && storage.getSearch().searchByNameEquals(searchByName)) { // do NOT use storage when using name search (e.g. from dashboard)
search = storage.getSearch();
}

Expand All @@ -180,7 +180,7 @@ public Search<C> load() {
// search.searchWasReload();
}

if (searchByName != null) {
if (searchByName != null && !search.searchByNameEquals(searchByName)) {
if (SearchBoxModeType.FULLTEXT.equals(search.getSearchMode())) {
search.setFullText(searchByName);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,5 +483,15 @@ public PrismContainerDefinition<C> getContainerDefinitionOverride() {
return containerDefinitionOverride;
}

public boolean searchByNameEquals(String nameValueToCompare) {
String nameValue = null;
if (SearchBoxModeType.BASIC.equals(getSearchMode())) {
PropertySearchItemWrapper nameItem = findPropertySearchItem(ObjectType.F_NAME);
nameValue = nameItem != null && nameItem.getValue() != null ? (String) nameItem.getValue().getValue() : null;
} else if (SearchBoxModeType.FULLTEXT.equals(getSearchMode())) {
nameValue = getFullText();
}
return nameValueToCompare != null && nameValueToCompare.equals(nameValue);
}

}

0 comments on commit 7363149

Please sign in to comment.