contentbylabel dont work anymore with report-on

  • 1
  • Problem
  • Updated 2 years ago
Hello,
I'm using this macro on confluence 5.6.4 with reporting 5.5.2:

<code>
<h2>Dossier d'assistance</h2>
        <p>
          <ac:structured-macro ac:name="contentbylabel">
            <ac:parameter ac:name="spaces">
              <ri:space ri:space-key="BDCASSISTANCE"/>
              <ri:space ri:space-key="ORGCSERVSTASS"/>
            </ac:parameter>
            <ac:parameter ac:name="showLabels">false</ac:parameter>
            <ac:parameter ac:name="labels">%content:title &gt; text:first 4%,dossier_assistance</ac:parameter>
            <ac:parameter ac:name="showSpace">false</ac:parameter>
            <ac:parameter ac:name="operator">AND</ac:parameter>
          </ac:structured-macro>
        </p>
</code>

After upgrade with confluence 5.9.5 and reporting 6.1.1, It doesnt work anymore.
An error "broken macro" on the page appears.

The logs throws this:
<code>
2016-03-22 14:06:47,225 WARN [macro-migration:thread-1] [xhtml.storage.macro.StorageMacroV2Marshaller] getMigratedDefinition Unable to migrate macro during Storage marshall
com.atlassian.confluence.content.render.xhtml.XhtmlException: Error migrating macro 'contentbylabel' in content 'ContentId{id=473890844}' from schema version 1. Message: Unable to migrate contentbylabel parameters > '%page:parent' is an invalid label.
        at com.atlassian.confluence.impl.macro.schema.DefaultMacroSchemaMigrator.migrateSchemaIfNecessary(DefaultMacroSchemaMigrator.java:52)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.StorageMacroV2Marshaller.getMigratedDefinition(StorageMacroV2Marshaller.java:145)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.StorageMacroV2Marshaller.lambda$marshal$461(StorageMacroV2Marshaller.java:78)
        at com.atlassian.confluence.content.render.xhtml.Streamables.writeToString(Streamables.java:188)
        at com.atlassian.confluence.content.render.xhtml.DefaultXhtmlContent.convertMacroDefinitionToStorage(DefaultXhtmlContent.java:170)
        at com.atlassian.confluence.macro.xhtml.XhtmlWikiMarkupMacroMigrator.lambda$migrate$163(XhtmlWikiMarkupMacroMigrator.java:65)
        at com.atlassian.confluence.content.render.xhtml.storage.DefaultContentTransformerFactory.lambda$getTransformer$729(DefaultContentTransformerFactory.java:101)
        at com.atlassian.confluence.content.render.xhtml.UnmarshalMarshalFragmentTransformer.transform(UnmarshalMarshalFragmentTransformer.java:29)
        at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transformFragment(DefaultFragmentTransformer.java:141)
        at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transform(DefaultFragmentTransformer.java:123)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.DefaultStorageMacroBodyParser.transformMacroBody(DefaultStorageMacroBodyParser.java:71)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.DefaultStorageMacroBodyParser.getMacroBody(DefaultStorageMacroBodyParser.java:54)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.StorageMacroV2Unmarshaller.unmarshal(StorageMacroV2Unmarshaller.java:132)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.DelegatingStorageMacroUnmarshaller.unmarshal(DelegatingStorageMacroUnmarshaller.java:42)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.DelegatingStorageMacroUnmarshaller.unmarshal(DelegatingStorageMacroUnmarshaller.java:18)
        at com.atlassian.confluence.content.render.xhtml.UnmarshalMarshalFragmentTransformer.transform(UnmarshalMarshalFragmentTransformer.java:28)
        at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transformFragment(DefaultFragmentTransformer.java:141)
        at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transform(DefaultFragmentTransformer.java:123)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.DefaultStorageMacroBodyParser.transformMacroBody(DefaultStorageMacroBodyParser.java:71)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.DefaultStorageMacroBodyParser.getMacroBody(DefaultStorageMacroBodyParser.java:54)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.StorageMacroV1Unmarshaller.parseRichTextMacroBody(StorageMacroV1Unmarshaller.java:120)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.StorageMacroV1Unmarshaller.unmarshal(StorageMacroV1Unmarshaller.java:88)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.DelegatingStorageMacroUnmarshaller.unmarshal(DelegatingStorageMacroUnmarshaller.java:40)
        at com.atlassian.confluence.content.render.xhtml.storage.macro.DelegatingStorageMacroUnmarshaller.unmarshal(DelegatingStorageMacroUnmarshaller.java:18)
        at com.atlassian.confluence.content.render.xhtml.UnmarshalMarshalFragmentTransformer.transform(UnmarshalMarshalFragmentTransformer.java:28)
        at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transformFragment(DefaultFragmentTransformer.java:141)
        at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transform(DefaultFragmentTransformer.java:123)
        at com.atlassian.confluence.content.render.xhtml.storage.StorageXhtmlTransformer.transform(StorageXhtmlTransformer.java:41)
        at com.atlassian.confluence.content.render.xhtml.DefaultXhtmlContent.replaceMacroDefinitionsWithString(DefaultXhtmlContent.java:195)
        at com.atlassian.confluence.macro.xhtml.XhtmlWikiMarkupMacroMigrator.migrate(XhtmlWikiMarkupMacroMigrator.java:52)
        at com.atlassian.confluence.content.render.xhtml.migration.macro.ContentEntityMigrationBatchTask.apply(ContentEntityMigrationBatchTask.java:53)
        at com.atlassian.confluence.content.render.xhtml.migration.macro.ContentEntityMigrationBatchTask.apply(ContentEntityMigrationBatchTask.java:31)
        at com.atlassian.confluence.content.render.xhtml.migration.macro.IndexingBatchTask.apply(IndexingBatchTask.java:26)
        at com.atlassian.confluence.content.render.xhtml.migration.macro.IndexingBatchTask.apply(IndexingBatchTask.java:14)
        at com.atlassian.confluence.content.render.xhtml.migration.WorkSourceBatchRunner$1.doInTransactionWithoutResult(WorkSourceBatchRunner.java:84)
        at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
        at com.atlassian.confluence.content.render.xhtml.migration.WorkSourceBatchRunner.lambda$run$164(WorkSourceBatchRunner.java:77)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Unable to migrate contentbylabel parameters
        at com.atlassian.confluence.plugins.macros.advanced.contentbylabel.LabelledContentMacroCqlSchemaMigrator.getCql(LabelledContentMacroCqlSchemaMigrator.java:71)
        at com.atlassian.confluence.plugins.macros.advanced.contentbylabel.LabelledContentMacroCqlSchemaMigrator.migrate(LabelledContentMacroCqlSchemaMigrator.java:32)
        at com.atlassian.confluence.impl.macro.schema.DefaultMacroSchemaMigrator.migrateSchema(DefaultMacroSchemaMigrator.java:61)
        at com.atlassian.confluence.impl.macro.schema.DefaultMacroSchemaMigrator.migrateSchemaIfNecessary(DefaultMacroSchemaMigrator.java:37)
        ... 41 more
Caused by: com.atlassian.confluence.macro.params.ParameterException: '%page:parent' is an invalid label.
        at com.atlassian.confluence.macro.query.params.BooleanQueryFactoryParameter.createBooleanQueryFactory(BooleanQueryFactoryParameter.java:63)
        at com.atlassian.confluence.macro.query.params.BooleanQueryFactoryParameter.findObject(BooleanQueryFactoryParameter.java:49)
        at com.atlassian.confluence.macro.query.params.BooleanQueryFactoryParameter.findObject(BooleanQueryFactoryParameter.java:21)
        at com.atlassian.confluence.macro.params.BaseParameter.findValue(BaseParameter.java:129)
        at com.atlassian.confluence.plugins.macros.advanced.contentbylabel.LegacyParameterConverter.getLabelExpression(LegacyParameterConverter.java:111)
        at com.atlassian.confluence.plugins.macros.advanced.contentbylabel.LegacyParameterConverter.buildQueryStringFromLegacyParameters(LegacyParameterConverter.java:51)
        at com.atlassian.confluence.plugins.macros.advanced.contentbylabel.LabelledContentMacroCqlSchemaMigrator.getCql(LabelledContentMacroCqlSchemaMigrator.java:65)
        ... 44 more

</code>

Not sure if it's reporting or contentbylabel the source problem ?

thanks for any help.

Michael
Photo of michael regelin

michael regelin

  • 346 Posts
  • 2 Reply Likes
  • confident

Posted 2 years ago

  • 1
Photo of Nurhana Ziana Bt. Hanafi

Nurhana Ziana Bt. Hanafi, Employee

  • 3500 Posts
  • 269 Reply Likes
Hello Michael,

I suspect this issue is caused by new implementation for contentbylabel filters in Confluence 5.9, as mentioned here. We would need to investigate more on possibilities to retain this behavior, or workaround for this.

Thanks&Regards,
Ziana
Photo of michael regelin

michael regelin

  • 346 Posts
  • 2 Reply Likes
Hi Ziana,

How are you going ?

Since this post 6 months ago, do you know if it is possible to inject value inside the contentbylabel macro ?
Thanks,

Michael