Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create a new version because an owningcollection is null #731

Merged
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
5 changes: 4 additions & 1 deletion dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ public static Metadata retrieveMetadata(Context context, Item item) {
if (restricted) {
other.getField().add(createValue("restrictedAccess", "true"));
}
other.getField().add(createValue("owningCollection", item.getOwningCollection().getName()));
// Because we reindex Solr, which is not done in vanilla
// The owning collection for workspace items is null
other.getField().add(createValue("owningCollection",
item.getOwningCollection() != null ? item.getOwningCollection().getName() : null));
other.getField().add(createValue("itemId", item.getID().toString()));
metadata.getElement().add(other);

Expand Down
Loading