Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-9489

The Excerpt Macro no longer works in comments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 2.6.1
    • None
    • None

    Description

      Putting an {excerpt} macro in a comment (which admittedly may make no sense) now produces this error message in the comment:

      Error formatting macro: excerpt: java.lang.ClassCastException: com.atlassian.confluence.pages.Comment

      And this stacktrace in the log:

      2007-09-17 21:25:00,596 ERROR [http-8080-Processor25] [renderer.v2.components.MacroRendererComponent] processMacro Unexpected error formatting macro: excerpt
       -- url: /display/~don.willis@atlassian.com/Home | userName: don.willis@atlassian.com | action: viewpage | page: 16482364
      java.lang.ClassCastException: com.atlassian.confluence.pages.Comment
      	at com.atlassian.confluence.renderer.v2.macros.ExcerptMacro.execute(ExcerptMacro.java:63)
      	at com.atlassian.renderer.v2.macro.ResourceAwareMacroDecorator.execute(ResourceAwareMacroDecorator.java:45)
      	at com.atlassian.renderer.v2.components.MacroRendererComponent.processMacro(MacroRendererComponent.java:254)
      	at com.atlassian.renderer.v2.components.MacroRendererComponent.makeMacro(MacroRendererComponent.java:150)
      	at com.atlassian.renderer.v2.components.WikiContentRendererHandler.handleMacro(WikiContentRendererHandler.java:18)
      ...
      

      The reason for this is pretty clear: That line is casting the Comment to an (AbstractPage). The scary bit is that the convertXHtmlToWikiMarkup method to which the AbstractPage would be passed, doesn't even use that page, so passing (AbstractPage)null would work (but obviously isn't a good idea).

      This seems to have come in with the fix for CONF-6342.

      Attachments

        Activity

          People

            agnes@atlassian.com Agnes Ro
            don.willis@atlassian.com Don Willis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: