Summary:
contentbylabel throws Java errors when embedded into a BLOG or COMMENT object
Discussion:
I was trying to include a list of content pages from a different space by using the contentbylabel macro. I discovered the following:
- the macro works fine when embedded in a PAGE object;
- the macro will work in page preview mode when a new BLOG object is created but then will give a Java error on subsequent viewings of that BLOG object.
- the macro will give a Java error when embedded in a COMMENT object.
Proof of Concept:
I uncovered this problem on my Confluence 2.2.5 but I was easily able to replicate it in Atlassian's Confluence 2.2.9 test space. See http://confluence.atlassian.com/display/TEST/2006/09/23/contentbylabel+macro+test+in+news
Sample Macro Call:
{contentbylabel:permissions|key=CONF20}
Error formatting macro: contentbylabel: java.lang.ClassCastException: com.atlassian.confluence.pages.BlogPost
Error in 2.2.9 COMMENT Post:
Error formatting macro: contentbylabel: java.lang.ClassCastException: com.atlassian.confluence.pages.Comment
Error in 2.2.5 BLOG Post:
Error formatting macro: contentbylabel: java.lang.ClassCastException