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

Renaming a field of an application with apostrophe in its name fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.4-rc-1
    • 7.4-milestone-2
    • App Within Minutes
    • None
    • Easy
    • N/A
    • N/A

    Description

      Follow this steps to reproduce:

      • Create an application, using App Within Minutes, with an apostrophe in its name, e.g. "Let's go!"
      • Create an application entry
      • Edit the application and rename one of the fields (advanced configuration)
      • Click the Next Step button

      The rename fails.

      Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [xwiki:AppWithinMinutes.ClassEditSheet]
      	at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:224)
      	at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:198)
      	at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:124)
      	... 175 more
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'execute' in  class org.xwiki.query.internal.ScriptQuery threw exception org.xwiki.query.QueryException: Exception while translating [from doc.object('WizardTest.testCreateApplication.\.'/%&y-}Ntâ.Code.\.'/%&y-}NtâClass') as obj where doc.fullName not in (:className,:templateName)] XWQL query to the [hql] language. Query statement = [from doc.object('WizardTest.testCreateApplication.\.'/%&y-}Ntâ.Code.\.'/%&y-}NtâClass') as obj where doc.fullName not in (:className,:templateName)] at 19:xwiki:AppWithinMinutes.ClassEditSheet[line 478, column 46]
      	at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187)
      	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
      	at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
      	at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:318)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      	at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
      	at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
      	at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      	at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
      	at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
      	at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      	at org.apache.velocity.runtime.parser.node.ASTElseIfStatement.render(ASTElseIfStatement.java:92)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
      	at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:256)
      	at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
      	... 177 more
      Caused by: org.xwiki.query.QueryException: Exception while translating [from doc.object('WizardTest.testCreateApplication.\.'/%&y-}Ntâ.Code.\.'/%&y-}NtâClass') as obj where doc.fullName not in (:className,:templateName)] XWQL query to the [hql] language. Query statement = [from doc.object('WizardTest.testCreateApplication.\.'/%&y-}Ntâ.Code.\.'/%&y-}NtâClass') as obj where doc.fullName not in (:className,:templateName)]
      	at org.xwiki.query.xwql.internal.XWQLQueryExecutor.execute(XWQLQueryExecutor.java:123)
      	at org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:71)
      	at org.xwiki.query.internal.SecureQueryExecutorManager.execute(SecureQueryExecutorManager.java:67)
      	at org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:287)
      	at org.xwiki.query.internal.ScriptQuery.execute(ScriptQuery.java:237)
      	at sun.reflect.GeneratedMethodAccessor952.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	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)
      	... 201 more
      Caused by: org.xwiki.query.jpql.parser.ParserException: [1,92] expecting: ')'
      	at org.xwiki.query.jpql.parser.Parser.parse(Parser.java:1385)
      	at org.xwiki.query.jpql.internal.JPQLParser.parse(JPQLParser.java:46)
      	at org.xwiki.query.xwql.internal.hql.XWQLtoHQLTranslator.translate(XWQLtoHQLTranslator.java:55)
      	at org.xwiki.query.xwql.internal.XWQLQueryExecutor.execute(XWQLQueryExecutor.java:90)
      	... 211 more
      

      Attachments

        Activity

          People

            mflorea Marius Dumitru Florea
            mflorea Marius Dumitru Florea
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: