Uploaded image for project: 'Document Management System (closed)'
  1. Document Management System (closed)
  2. MGNLDMS-63

Path.getUniqueLabel doesn't manage the trailing "/" of parent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • 1.1
    • None

    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 "/".

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              pbaerfuss Philipp Bärfuss
              iorga Anthony Ogier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1m
                  1m
                  Remaining:
                  Remaining Estimate - 1m
                  1m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified