[MGNLDAM-529] When an asset is duplicated, the filename shown on UI doesn't reflect real node name Created: 10/Dec/14  Updated: 27/Oct/16  Resolved: 24/Feb/16

Status: Closed
Project: Magnolia DAM Module
Component/s: None
Affects Version/s: 2.0.5, 2.1.3
Fix Version/s: 2.1.4

Type: Bug Priority: Major
Reporter: Haaris Mohammed Assignee: Oanh Thai Hoang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 2d 3h
Original Estimate: 2d

Attachments: PNG File asset-name.png     PNG File asset_name_and_node_name_mismatch.png     PNG File asset_name_has_extension.png     PNG File asset_name_without_extension.png    
Issue Links:
Cloners
is cloned by MGNLDAM-678 When an asset is pasted, the filename... Closed
dependency
depends upon MAGNOLIA-6550 Provide new API getUniqueLabel of Pat... Closed
relation
is related to MGNLDAM-631 A duplicated asset should be added ri... 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:
Sprint: Saigon 32
Story Points: 3

 Description   

internal name (name to be used in URL to download the asset) is not correct in browser UI and "Edit Asset" UI.
This especially causes confusion when author duplicates a file and moves it to another folder. oldfolder/image.jpg newfolder/image0.jpg but in UI it isshown as image.jpg which causes confusion.
Magnolia Version: 5.3.5, 5.4.4


EDIT
The node name could be changed to something like foo0.png rather than foo.png0 and the asset name likewise, else one cannot distinguish at a first glance what's the copy and what's the original (unless one looks at the node name). After duplication one could end up with something like this


AGREEMENTS

After fixing the bug, there are some OK cases that you will found regarding to asset name.
1. In case asset name has extension

2. In case asset name has not extension

3. In case asset name does not have the same base name with node name. This case happened when we tried to rename asset by Rename node action. This case still ok due to this ticket just supported to make the filename reflect real node name



 Comments   
Comment by Federico Grilli [ 08/Jan/16 ]

Thanks for reporting this issue and sorry for our (very) belated reply (somehow it escaped our radar :/ ). We recently stumbled across this issue while doing some QA for another DAM fix (see related ticket). I'll add some details to the description and hopefully this will be tackled in one of the next maintenance releases.

Comment by Oanh Thai Hoang [ 25/Feb/16 ]

Discussing asset name will be found in https://git.magnolia-cms.com/projects/MODULES/repos/dam/pull-requests/9/overview?commentId=3372

Comment by Ngoc Nguyenthanh [ 26/Feb/16 ]

Regarding case-sensitive on extension of file
Steps:

  • I upload an zipFile.zip.
  • Then modified the asset name to zipFile.ZIP
  • When I duplicate asset, it compare 2 extensions and remove extension of the duplicated asset. Now name of the duplicated asset becomes zipFile0 (without extension)

Expected result: zipFile0.ZIP

Here is an agreement with mgeljic

Because with your rename, you made it inconsistent (well, case-inconsistent), so you end up in that state:

/zipFile.zip (node)
    - name: zipFile.ZIP
    - binary node
          - fileName: zipFile.zip
          - extension: zip

when duplicating, node name takes precedence for uniqueness check:

/zipFile0.zip
    - name: zipFile0
    - binaryNode
           - fileName: zipFile0.zip
           - extension: zip

we would have to detect "common patterns" between node name and name property, but it's really not worth the pain, imo
changing asset name to zipFile.ZIP is considered just as inconsistent as changing it to fooBar.zip

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