Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7306

The class editor doesn't validate properly the field names

    Details

    • Tests:
      Integration
    • Difficulty:
      Easy
    • Similar issues:

      Description

      Follow this steps to reproduce:

      • edit the application class
      • add a digit in front of a field name (not the pretty name; open the configuration panel for that field and change the field name)
      • save

      As a result you get an ugly exception that makes the application class (and thus the application) unusable.

      Wrapped Exception: Error on line 12 of document  : The content of elements must consist of well-formed character data or markup.
      Nested exception: The content of elements must consist of well-formed character data or markup.
      at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:853)
      at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:283)
      at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1449)
      at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1492)
      at com.xpn.xwiki.XWiki.getXClass(XWiki.java:6404)
      at com.xpn.xwiki.objects.classes.BaseClass.newCustomClassInstance(BaseClass.java:1059)
      at com.xpn.xwiki.doc.XWikiDocument.createXObject(XWikiDocument.java:2005)
      at com.xpn.xwiki.doc.XWikiDocument.updateXObjectFromRequest(XWikiDocument.java:6534)
      at com.xpn.xwiki.doc.XWikiDocument.updateObjectFromRequest(XWikiDocument.java:6558)
      at com.xpn.xwiki.doc.XWikiDocument.updateObjectFromRequest(XWikiDocument.java:6519)
      at com.xpn.xwiki.doc.XWikiDocument.updateObjectFromRequest(XWikiDocument.java:6498)
      at com.xpn.xwiki.api.Document.updateObjectFromRequest(Document.java:2065)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
      ... 131 more
      

      The exception is caused by the fact that the xclass XML has a tag whose name starts with a digit, which is an invalid XML name.

        Attachments

          Activity

            People

            • Assignee:
              mflorea Marius Dumitru Florea
              Reporter:
              mflorea Marius Dumitru Florea
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: