Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
None
-
None
Description
Uploaded files with the same filename but different binary node names (e.g. if in different languages "binaryNodeName_de" "binaryNodeName_fr") are now stored on the same path in DAM -> so all but one file cannot be migrated
Log:
Line 167: 2014-10-08 16:14:22,961 WARN info.magnolia.dam.app.setup.migration.MoveContentToDamMigrationTask - '/moved_uploaded/home/.../content/01/teasers/0' path already exists in dam repository. Uploaded file will not be migrated '/home/.../content/01/teasers/0'
I fixed this issue in this way (MoveContentToDamMigrationTask):
protected String copyToDam(final Node dataNodeResource) throws RepositoryException {
String nodeIdentifier = "";
final String binaryPath = dataNodeResource.getPath();
final String fileName = createFileName(dataNodeResource);
// Check
if (this.damUploadedRootNode.hasNode(binaryPath.replaceFirst("/", "") + "/" + fileName)) {
final String targetPath = this.damUploadedRootNode.getPath() + "/" + binaryPath;
log.warn("'{}' path already exists in dam repository. Uploaded file will not be migrated '{}'", targetPath, binaryPath);
return null;
}
// Create an AssetNode
final Node assetNode = createAssetNodeAndSubFolder(this.damUploadedRootNode, binaryPath, fileName);
nodeIdentifier = assetNode.getIdentifier();
updateAssetProperty(assetNode, dataNodeResource);
// Create resource Node
final Node assetNodeResource = assetNode.addNode(AssetNodeTypes.AssetResource.RESOURCE_NAME, AssetNodeTypes.AssetResource.NAME);
updateResourceProperty(assetNodeResource, dataNodeResource);
// Save
this.damSession.save();
return nodeIdentifier;
}
This should be fixed.
Checklists
Acceptance criteria