Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-685

The content macro sets the syntax with wrong type, leading to cast errors

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce:

      Create a document with content

      {{content syntax="xwiki/2.1"}}{{cache id="content"}}Hello world!{{/cache}}{{/content}}

      Expected result:

      The text "Hello World!" is displayed.

      Actual result:

      An error

      Failed to execute the [cache] macro. Cause: [class java.lang.String cannot be cast to class org.xwiki.rendering.syntax.Syntax (java.lang.String is in module java.base of loader 'bootstrap'; org.xwiki.rendering.syntax.Syntax is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @1506f20f)]. Click on this message for details.

      is displayed. This is because the content macro erroneously sets the syntax metadata as a string instead of Syntax object as indicated in the documentation.

      Attachments

        Issue Links

          Activity

            People

              MichaelHamann Michael Hamann
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: