[MAGNOLIA-2788] InstallContext should provide the correct "current module" to ModuleVersionHandlers at instantiation time Created: 15/Jun/09  Updated: 23/Jan/13  Resolved: 15/Jun/09

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 4.1
Fix Version/s: 4.1.1

Type: Bug Priority: Major
Reporter: Magnolia International Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
supersession
is superseded by MAGNOLIA-2787 InstallContext should not be availabl... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

Considering the following code:

public class MyModuleVersionHandler extends DefaultModuleVersionHandler {
    public MyModuleVersionHandler() {
        super();
        final ModuleDefinition currentModule = ModuleManager.Factory.getInstance().getInstallContext().getCurrentModuleDefinition();
        System.out.println(currentModule);
    }
}

With 4.1, this print the ModuleDefinition of the module preceding the one corresponding to this version handler instead of "MyModule".

This was originally not intended to work at all, so we will possibly prevent this from working with 4.2 - see MAGNOLIA-2787 !


Generated at Mon Feb 12 03:40:06 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.