Issue Details (XML | Word | Printable)

Key: IZPACK-16
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Piotr Skowronek
Reporter: Piotr Skowronek
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IzPack

Some panels are displayed although suitable conditions are not met

Created: 25/Feb/08 09:03 AM   Updated: 29/Feb/08 02:29 PM  Due: 26/Feb/08   Resolved: 26/Feb/08 07:26 AM
Return to search
Component/s: Installer
Affects Version/s: 3.11.0
Fix Version/s: 4.0.0

Time Tracking:
Original Estimate: 4 hours
Original Estimate - 4 hours
Remaining Estimate: 4 hours
Remaining Estimate - 4 hours
Time Spent: Not Specified
Time Spent - Not Specified

File Attachments: 1. File 20080225_panel_cond.diff (8 kB)


Patch Submitted: Yes


 Description  « Hide

There is a bug regarding which panel can be showed.
The panel condition associated along panel declaration (in install.xml / panels / panel)
is sometimes ignored causing the panel to appear although the condition
is not met.

The source of the problem is that the checking, whether to show the panel or not,
is done in two places. InstallerFrame can decide whether to show the panel
by checking the condition attribute associated along the panel declaration. The panel
itself can decide whether it should be displayed or not, by checking conditions
defined using createForPack elements within UserInputPanel's body.

Here is simplified list of steps how this is done currently:
1) InstallerFrame searches for next/prev panel that can be showed using #canShow method.
If it was found and condition is met, then panel will be activated. Here, we can go to step 2.

2) The panel itself can decide whether it wants to be showed or not, for example
UserInputPanel does this checking in the method: #panelActivate. If the conditions
are not met, then it invokes InstallerFrame#skipPanel(). The skipPanel searches next/previous
panel without doing any checking, hence the panel is being displayed although it shouldn't be.
This method skips conditions checking that otherwise would be issued using
InstallerFrame#canShow().

The fix is to amend InstallerFrame#skipPanel() to use #navigateNext() and
#navigatePrevious() instead of #switchPanel(). These two methods invokes canShow()
method, to check whether panel is allowed to be showed.

In the attachment one can find patch that corrects the problem. Feel free to comment.



Julien Ponge added a comment - 25/Feb/08 09:33 AM

I agree to merge the proposed fix.


Julien Ponge added a comment - 29/Feb/08 02:29 PM

Closing resolved issues (they should not stay "resolved" but get closed)