Skip to content

Commit

Permalink
MID-7898 Duplicate search items appear
Browse files Browse the repository at this point in the history
  • Loading branch information
Kateryna Honchar committed May 2, 2022
1 parent 1fbba4f commit d2351f8
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public static <C extends Containerable> Search<C> createSearch(Class<C> type, St
WebComponentUtil.containerClassToQName(PrismContext.get(), type), collectionViewName, Search.PanelType.DEFAULT);
if (config != null) {
SearchConfigurationWrapper<C> preconfiguredSearchConfigWrapper = new SearchConfigurationWrapper<C>(type, config);
searchConfigWrapper = combineSearchBoxConfiguration(searchConfigWrapper, preconfiguredSearchConfigWrapper, true);
searchConfigWrapper = combineSearchBoxConfiguration(searchConfigWrapper, preconfiguredSearchConfigWrapper);
}
searchConfigWrapper.setCollectionViewName(collectionViewName);
return createSearch(searchConfigWrapper, null, modelServiceLocator, Search.PanelType.DEFAULT, false);
Expand Down Expand Up @@ -570,12 +570,14 @@ private static void addOrReplaceSearchItemWrapper(SearchConfigurationWrapper con
List<AbstractSearchItemWrapper> items = config.getItemsList();
boolean isProcessed = false;
if (customItem instanceof PropertySearchItemWrapper) {
for (AbstractSearchItemWrapper item : items) {
Iterator<AbstractSearchItemWrapper> itemsIterator = items.iterator();
while (itemsIterator.hasNext()) {
AbstractSearchItemWrapper item = itemsIterator.next();
if (!(item instanceof PropertySearchItemWrapper)) {
continue;
}
if (((PropertySearchItemWrapper<?>) item).getPath().equivalent(((PropertySearchItemWrapper<?>) customItem).getPath())) {
items.remove(item);
itemsIterator.remove();
items.add(customItem);
isProcessed = true;
break;
Expand Down

0 comments on commit d2351f8

Please sign in to comment.