[
http://jira.magnolia-cms.com/browse/MAGNOLIA-2787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jan Haderka updated MAGNOLIA-2787:
----------------------------------
Fix Version/s: Backlog
(was: 4.3.x)
I would say this is part of bigger bundle - rewrite module management to use
guide ioc introduced in 4.5
> InstallContext should not be available to ModuleVersionHandlers at
> instantiation time
> -------------------------------------------------------------------------------------
>
> Key: MAGNOLIA-2787
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2787
> Project: Magnolia
> Issue Type: Bug
> Security Level: Public
> Components: core
> Affects Versions: 4.1
> Reporter: Grégory Joseph
> Assignee: Philipp Bärfuss
> Priority: Major
> Fix For: Backlog
>
>
> Considering the following code:
> {code}
> public class MyModuleVersionHandler extends DefaultModuleVersionHandler {
> public MyModuleVersionHandler() {
> super();
> final ModuleDefinition currentModule =
> ModuleManager.Factory.getInstance().getInstallContext().getCurrentModuleDefinition();
> System.out.println(currentModule);
> }
> }
> {code}
> As of 4.1, this print the ModuleDefinition of the module preceding the one
> corresponding to this version handler.
> As of 4.1.1, this will return the correct module; to avoid confusion however,
> I'd be in favor of preventing this sort of code to run at all. It is hard to
> prevent this sort of code from running at the moment because of the singleton
> nature of this API. By using IoC, I'm fairly convinced we could achieve
> something cleaner.
> In further versions, this should probably not be feasible at all, since one
> should only use the InstallContext in the execute method of Tasks. Also see
> {{info.magnolia.module.delta.RegisterModuleServletsTask}}, which uses the
> InstallContext at execution time to instanciate other tasks, which is
> something that might need to be simpler/cleaner too.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------