DS-466 : Just realized the code fixed in r5887 appears in two places -- both in ingestAll() and in replaceAll(). It was fixed in ingestAll() in r5887. This commit also ensures it is fixed in replaceAll() method.

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5893 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Tim Donohue
2010-11-22 20:53:10 +00:00
parent 55d4bc0cea
commit 70d0c9e8a8

View File

@@ -273,8 +273,14 @@ public abstract class AbstractPackageIngester
// A Collection can map to Items that it does not "own".
// If a Collection package has an Item as a child, it
// should be mapped regardless of ownership.
if (Constants.COLLECTION == replacedDso.getType())
// If a Collection package has an Item as a child, it
// should be mapped regardless of ownership.
// Note: Only perform this mapping if new items were ingested to this collection
if (Constants.COLLECTION == replacedDso.getType() && dsoIngestedList.size()>oldSize)
{
// Since running 'replaceAll' on an item, will only ingest one Item at most,
// Just make sure that item is mapped to this collection.
Item childItem = (Item)dsoIngestedList.get(oldSize);
Collection collection = (Collection)replacedDso;
if (!childItem.isIn(collection))