Nested report-info macro injection does not work in Confluence 4

Stefan Eike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2012

Hi,

we're trying to use a Confluence 3 template in Confluence 4. But it seems, that the report-info macro get messed from the XML converting process. Because it is a live-template, all pages created with this template are broken. Could you please help to solve the problem?

We're using the following code snippet in the template. As you see, we use two report-info macros to generate a link, one for the link name and one for the url. Some characters are being changed during the templating process.

{report-list}
  {local-reporter:data:Changesets}
    {text-sort:ChangesetNumber}
  {local-reporter}

  {report-body}
    [{report-info:ChangesetNumber} |http://as-tfs:8080/tfs/web/UI/Pages/Scc/ViewChangeset.aspx?changeset={report-info:ChangesetNumber}&pguid=c6ccccde-9e45-4372-ba61-859e2223d322] {report-info:ChangesetComment}
  {report-body}

  {report-empty}
    Please {link-to:page edit}edit{link-to} to add changesets.
  {report-empty}
{report-list}

When creating a page using this template, I get the following code mess:

And this is the same part in the source code view:

Any ideas? Thanks for your support!

1 answer

1 accepted

0 votes
Answer accepted
CharlesH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2012

It looks to me from your markup that you've not closed your report-info tags. Perhaps this wasn't necessary in 3.x, but in 4 I think it is. Try closing each one, but for a simpler approach I would recommend injecting the values you need into the text. It's more predictable than using report-info I think, in terms of not introducing spaces or line breaks.

Stefan Eike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2012

No change, same mistake:

{report-body}
    [{report-info:ChangesetNumber}{report-info}|http://as-tfs:8080/tfs/web/UI/Pages/Scc/ViewChangeset.aspx?changeset={report-info:ChangesetNumber}{report-info}&pguid=c6ccccde-9e45-4372-ba61-859e2223d322] {report-info:ChangesetComment}{report-info}
  {report-body}

CustomWare says, that no closing tag ist needed:

{code}
{report-info:[key=][key chain]|format=[date/number format]|render=[none/wiki]|default=[default value]}

OR

{report-info:[key=][prefix:]value key|format=[date/number format]|render=[none/wiki]}default value{report-info}
{code}

Sorry, but I'm not sure what you mean. What would you recommend, how should I inject the values into the text? The macro generates a list, well, I mean it did.

CharlesH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2012

See this link and the part about keychain injection: http://wiki.customware.net/repository/display/AtlassianPlugins/report-block

"This uses injection to put data into places the report-info macro can't go, such as inside link markup..."

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events