Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8273

Let Magnolia be more forgiving with leading and trailing spaces in node names

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 6.2.16
    • 6.2.14
    • None
    • None
    • Yes
    • Pages Maintenance 3, Pages Maintenance 4
    • 2

    Description

      To reproduce

      • create a new page by choosing a name led by a whitespace
      • Magnolia throws the runtime exception below

      Caused by: org.apache.jackrabbit.spi.commons.conversion.MalformedPathException: ' a space precedes this name' is not a valid path. ' ' not valid name start
      	at org.apache.jackrabbit.spi.commons.conversion.PathParser.parse(PathParser.java:392) ~[jackrabbit-spi-commons-2.20.0.jar:?]
      [...]
      	at info.magnolia.jcr.util.NodeNameHelper.getUniqueName(NodeNameHelper.java:127) ~[magnolia-core-6.2.1-SNAPSHOT.jar:?]
      	at 
      [...]
      info.magnolia.pages.app.action.browser.CreatePageAction.execute(CreatePageAction.java:92) ~[magnolia-pages-app-6.2.1-SNAPSHOT.jar:?]
      

      I guess Magnolia could be more forgiving by trimming leading and trailing spaces or NodeNameHelper.getUniqueName(..) could replace them with - character as it does with in name whitespaces.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                yen.lactue Yen Lac Tue
                fgrilli Federico Grilli
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - 0d
                      0d
                      Logged:
                      Time Spent - 2d 6h 55m
                      2d 6h 55m