Details
-
Bug
-
Resolution: Fixed
-
Major
-
5.4.4
-
None
-
Unknown
-
N/A
-
N/A
-
Description
When installing an extension, if it register MandatoryDocumentInitializer roles, their updateDocument() method should be called in each context (wiki) that the extension is installed in.
Note, that due to an issue soon to be resolved (see XWIKI-10352) in Utils#getComponentList() which cause the root CM to be used instead of the context CM, it will not be called on restart either.
The current workaround is the create a listener on ApplicationReadyEvent, WikiReadyEvent and ExtensionInstalledEvent to hook your own implementation of MandatoryDocumentInitializer#updateDocument(). Be careful to
- check that your listener is registered in the current context, since it will be called for any context
- use hashCode() to build the name of your listener, so its name is unique among all contexts (see XCOMMONS-213)
I attach a zip with 1 interface and 2 classes, showing a reimplementation of MandatoryDocumentInitializer based on such a listener to helps
Attachments
Issue Links
- is duplicated by
-
XWIKI-11687 Exception in install log when installing Ratings application in the extension manager
- Closed
- is related to
-
XWIKI-10352 All Oldcore Utils component related APIS should use context CM by default
- Closed