Skip to content

Commit

Permalink
don't show all collections after reload of collections page
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Alpers committed Feb 14, 2025
1 parent 1bfdf53 commit a7a1751
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
* <p>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a7a1751

Please sign in to comment.