Uploaded image for project: 'SR for Confluence - Development'
  1. SR for Confluence - Development
  2. SRCONF-1016

Macro Overrides have incorrect constructors

    XMLWordPrintableJSON

Details

    • SR4C Squad 127, SR4C Squad 128
    • 3
    • 0.3

    Description

      The Label Tools macros and Create Page macros both have examples in the docs that show how to make your own superclass that changes their parameters.

      https://scriptrunner.adaptavist.com/latest/confluence/macros/BundledMacros.html#_customise_macro_variables

      These examples fail with this error:

      Failed to instantiate AddLabelCustomVariables, Error creating bean with name 'AddLabelCustomVariables': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.confluence.security.PermissionManager' available: expected single matching bean but found 2: permissionManager,permissionManagerTarget
      

      https://scriptrunner.adaptavist.com/latest/confluence/macros/BundledMacros.html#_instructions

      The Create Page extension is broken because the constructor for that class has changed, though it could plausibly have similar dependency injection issues to the above.

      We need to fix the docs and provide some automated testing for these examples to make sure we update these examples in the future.

      Attachments

        Activity

          People

            aderossett Aidan Derossett
            jcarter Jonny Carter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: