Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/release-notes/8724-display-child-datasets-of-linked-dv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Datasets that are part of linked dataverse collections will now be displayed in
their linking dataverse collections. In order to fix the display of collections
that have already been linked you must re-index the linked collections. This
query will provide a list of commands to re-index the effected collections:

select 'curl http://localhost:8080/api/admin/index/dataverses/'
|| tmp.dvid from (select distinct dataverse_id as dvid
from dataverselinkingdataverse) as tmp

The result of the query will be a list of re-index commands such as:

curl http://localhost:8080/api/admin/index/dataverses/633

where '633' is the id of the linked collection.
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,7 @@ private List<Dataverse> findAllLinkingDataverses(DvObject dvObject){
dataset = (Dataset) dvObject;
linkingDataverses = dsLinkingService.findLinkingDataverses(dataset.getId());
ancestorList = dataset.getOwner().getOwners();
ancestorList.add(dataset.getOwner()); //to show dataset in linking dv when parent dv is linked
}
if(dvObject.isInstanceofDataverse()){
dv = (Dataverse) dvObject;
Expand Down Expand Up @@ -1661,6 +1662,11 @@ private List<String> retrieveDVOPaths(DvObject dvo) {
logger.info("failed to find dataverseSegments for dataversePaths for " + SearchFields.SUBTREE + ": " + ex);
}
List<String> dataversePaths = getDataversePathsFromSegments(dataverseSegments);
if (dataversePaths.size() > 0 && dvo.isInstanceofDataverse()) {
// removing the dataverse's own id from the paths
// fixes bug where if my parent dv was linked my dv was shown as linked to myself
dataversePaths.remove(dataversePaths.size() - 1);
}
/*
add linking paths
*/
Expand Down
9 changes: 0 additions & 9 deletions src/test/java/edu/harvard/iq/dataverse/api/LinkIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,6 @@ public void testDeepLinks() {
.body("data.total_count", equalTo(1))
.body("data.items[0].name", equalTo(level1a));

/**
* Remove this early return when you are ready to work on
* https://github.com/IQSS/dataverse/issues/7430 about strange linking
* behavior.
*/
if (true) {
return;
}

Response createLevel2a = UtilIT.createSubDataverse(UtilIT.getRandomDvAlias() + "-level2a", null, apiToken, level1a);
createLevel2a.prettyPrint();
String level2a = UtilIT.getAliasFromResponse(createLevel2a);
Expand Down