[MGNLDAM-736] File renaming not persisted in node's name Created: 04/Jan/18  Updated: 30/Sep/21  Resolved: 30/Sep/21

Status: Closed
Project: Magnolia DAM Module
Component/s: None
Affects Version/s: 2.3
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: y2k
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
relation
is related to MGNLDAM-767 uploading more same assets breaks ren... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 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.



 Comments   
Comment by Mercedes Iruela [ 24/Sep/21 ]

Not reproducible in 6.2.11.

Comment by Marta Kobus [ 30/Sep/21 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

 

Thank you,

The Magnolia Team

Generated at Mon Feb 12 05:02:46 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.