Merge branch 'main' into feature-relationship-versioning-contribution

This commit is contained in:
Bruno Roemers
2022-06-17 10:13:21 +02:00
158 changed files with 13150 additions and 512 deletions

View File

@@ -26,6 +26,8 @@ import java.util.stream.Stream;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Logger;
import org.dspace.app.orcid.OrcidToken;
import org.dspace.app.orcid.service.OrcidTokenService;
import org.dspace.app.util.AuthorizeUtil;
import org.dspace.authorize.AuthorizeConfiguration;
import org.dspace.authorize.AuthorizeException;
@@ -124,6 +126,9 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
@Autowired(required = true)
private EntityTypeService entityTypeService;
@Autowired
private OrcidTokenService orcidTokenService;
protected ItemServiceImpl() {
super();
}
@@ -752,6 +757,11 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
harvestedItemService.delete(context, hi);
}
OrcidToken orcidToken = orcidTokenService.findByProfileItem(context, item);
if (orcidToken != null) {
orcidToken.setProfileItem(null);
}
//Only clear collections after we have removed everything else from the item
item.clearCollections();
item.setOwningCollection(null);