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

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

XMLWordPrintable

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

      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.

        Acceptance criteria

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

                Created:
                Updated:
                Resolved:

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