[MGNLDMS-63] Path.getUniqueLabel doesn't manage the trailing "/" of parent Created: 10/Nov/06  Updated: 04/Nov/15  Resolved: 04/Nov/15

Status: Closed
Project: Document Management System (closed)
Component/s: None
Affects Version/s: 1.1
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Anthony Ogier Assignee: Philipp Bärfuss
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: 1m
Time Spent: Not Specified
Original Estimate: 1m

Attachments: Text File Path.java.patch    
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

We are using a paragraph which has that iframe inside :
<iframe id="dmsTree" frameborder="0" src="${pageContext.request.contextPath}/.magnolia/trees/dms.html?path=${dmsPath}/"></iframe>
When we upload a file in the DMS Tree (with "New Document") we have an error because the path is doubled :

ERROR info.magnolia.cms.core.HierarchyManager HierarchyManager.java(isExist:422) 10.11.2006 11:21:54 Exception caught
javax.jcr.RepositoryException: invalid path:/parent//filename: '/parent//filename' is not a valid path: '' is not a legal path element: '/parent//filename' is not a valid path: '' is not a legal path element
at org.apache.jackrabbit.core.SessionImpl.itemExists(SessionImpl.java:790)
at info.magnolia.cms.core.HierarchyManager.isExist(HierarchyManager.java:419)
at info.magnolia.cms.core.Path.getUniqueLabel(Path.java:193)
at info.magnolia.module.dms.DocumentDialog.onPreSave(DocumentDialog.java:130)
at info.magnolia.module.admininterface.DialogMVCHandler.save(DialogMVCHandler.java:183)
...
Caused by: org.apache.jackrabbit.name.MalformedPathException: '/parent//filename' is not a valid path: '' is not a legal path element
at org.apache.jackrabbit.name.Path.parse(Path.java:454)
...

Here is a simple patch to Patch.getUniqueLabel to manage if the given parent already have a trailing "/".



 Comments   
Comment by Anthony Ogier [ 10/Nov/06 ]

Here's the patch

Comment by Michael Mühlebach [ 04/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

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