mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
Fix PatchMetadataIT failures by ensuring MetadataValue place is updated for virtual fields as well. Also minor code cleanup in PatchMetadataIT.
This commit is contained in:
@@ -97,7 +97,7 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(Item.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger();
|
||||
|
||||
@Autowired(required = true)
|
||||
protected ItemDAO itemDAO;
|
||||
@@ -1742,6 +1742,8 @@ prevent the generation of resource policy entry values with null dspace_object a
|
||||
*/
|
||||
@Override
|
||||
protected void moveSingleMetadataValue(Context context, Item dso, int place, MetadataValue rr) {
|
||||
// If this is a (virtual) metadata value representing a relationship,
|
||||
// then we must also update the corresponding Relationship with the new place
|
||||
if (rr instanceof RelationshipMetadataValue) {
|
||||
try {
|
||||
//Retrieve the applicable relationship
|
||||
@@ -1757,10 +1759,10 @@ prevent the generation of resource policy entry values with null dspace_object a
|
||||
//should not occur, otherwise metadata can't be updated either
|
||||
log.error("An error occurred while moving " + rr.getAuthority() + " for item " + dso.getID(), e);
|
||||
}
|
||||
} else {
|
||||
//just move the metadata
|
||||
rr.setPlace(place);
|
||||
}
|
||||
|
||||
// Update the MetadataValue object with the new place setting
|
||||
rr.setPlace(place);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user