Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-11716

Backward compatibility broken when registering a component in Groovy using Utils.getComponentManager()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 6.4.1, 6.2.6
    • 6.4, 6.2.5
    • Component
    • Unknown
    • N/A
    • N/A

    Description

      Apparently we broke backward compat and this is bad… We used to return the root Component Manager when calling Utils.getComponentManager()

      But it’s been modified and deprecated in XWiki 6.1M1 (XWIKI-10352) to return the Context Component Manager.

      Now, the new way of registering components has been to use the Component Manager script service introduced in XWiki 4.1M2 (see http://extensions.xwiki.org/xwiki/bin/view/Extension/Component+Module#HAccessfromScripts).

      However I’ve just noticed that it’s also been modified to return the Context CM instead of the Root CM.

      This means there’s now no way to dynamically register a new component from Groovy without using a deprecated API…

      So right now the only workaround is to use the deprecated method:

      Utils.getRootComponentManager()

      See mail thread: http://xwiki.markmail.org/thread/wvduq5p2b4rcvlzu

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: