Details
-
Bug
-
Resolution: Obsolete
-
Neutral
-
None
-
2.3
-
None
Description
When editing an asset replacing the media file with another one with different name, corresponding JCR node is not renamed accordingly and, as a consequence, file can not be accessed through a link pointing to the new renamed file.
This is happening due to the condition of being a new Node that is checked at the very beginning of setNodeName method in SaveAssetFormAction class:
info.magnolia.dam.app.assets.form.action.SaveAssetFormAction
@Override
protected void setNodeName(Node assetNode, JcrNodeAdapter item) throws RepositoryException {
if (item instanceof JcrNewNodeAdapter) {
// Get File Name
Node resourceNode = AssetNodeTypes.AssetResource.getResourceNodeFromAsset(assetNode);
String fileName = extractFileName(resourceNode);
if (StringUtils.isNotBlank(fileName)) {
setAssetPropertyName(item, assetNode, fileName);
// set the node name
String newNodeName = generateUniqueNodeNameForAsset(assetNode, fileName);
item.setNodeName(newNodeName);
NodeUtil.renameNode(assetNode, newNodeName);
}
}
}
See linked support ticket for more details about the issue.
Checklists
Acceptance criteria
Attachments
Issue Links
- is related to
-
MGNLDAM-767 uploading more same assets breaks rendering
-
- Closed
-