The Excerpt Macro no longer works in comments

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • 2.6.1
    • Affects Version/s: None
    • Component/s: None

      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.

              Assignee:
              Agnes Ro
              Reporter:
              Don Willis
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: