diff --git a/goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/CollectionViewBean.java b/goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/CollectionViewBean.java index eed18e02e0e8..fbf9f0ae7f96 100644 --- a/goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/CollectionViewBean.java +++ b/goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/CollectionViewBean.java @@ -117,6 +117,9 @@ public CollectionView getCollection(CMSCollectionContent content, int collection public CollectionView getCollection(CMSCollectionContent content, String topVisibleElement) throws PresentationException, IndexUnreachableException, IllegalRequestException { String myId = getCollectionId(content); + if (StringUtils.isBlank(topVisibleElement)) { + topVisibleElement = content.getCollectionName(); + } CollectionView collection = collections.get(myId); if (collection == null) { try { diff --git a/goobi-viewer-core/src/main/java/io/goobi/viewer/model/viewer/collections/CollectionView.java b/goobi-viewer-core/src/main/java/io/goobi/viewer/model/viewer/collections/CollectionView.java index 54a335da4049..0d91d068d85d 100644 --- a/goobi-viewer-core/src/main/java/io/goobi/viewer/model/viewer/collections/CollectionView.java +++ b/goobi-viewer-core/src/main/java/io/goobi/viewer/model/viewer/collections/CollectionView.java @@ -32,8 +32,6 @@ import java.util.Optional; import java.util.stream.Collectors; -import jakarta.ws.rs.core.UriBuilder; - import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.client.utils.URIBuilder; @@ -52,6 +50,7 @@ import io.goobi.viewer.model.search.CollectionResult; import io.goobi.viewer.model.urlresolution.ViewHistory; import io.goobi.viewer.model.viewer.PageType; +import jakarta.ws.rs.core.UriBuilder; /** *
@@ -289,7 +288,8 @@ public void calculateVisibleDcElements(boolean loadDescriptions) throws IllegalR } this.visibleCollectionList = sortDcList(visibleList, DataManager.getInstance().getConfiguration().getCollectionSorting(field), getTopVisibleElement(), splittingChar); - if (!isDisplayParentCollections() && StringUtils.isNotBlank(getTopVisibleElement()) && !this.visibleCollectionList.isEmpty()) { + if (!isIgnoreHierarchy() && !isDisplayParentCollections() && StringUtils.isNotBlank(getTopVisibleElement()) + && !this.visibleCollectionList.isEmpty()) { //if parent elements should be hidden, remove topElement from the list //This cannot be done earlier because it breaks sortDcList... this.visibleCollectionList.remove(0);