[Chameleon] QuickZoom bug

Eric Bridger eric at gomoos.org
Thu Aug 12 17:09:29 EDT 2004


I noticed a bug in the QuickZoom widget (Chameleon 1.99 beta 1 and 2).

The current selection: SEL_QUICKZOOM hidden variable was not getting
set, after the first submit, i.e. it was not sticky.  So if you quick
zoom, then pan, you lose the previous selection and wind up with the
first choice in your select list selected.  A minor problem since you
can then not select the first choice (it's an onChange event).

The problem is in the 

GetHTMLHiddenVariables() function.  The current value of SEL_QUICKZOOM
is not retrieved and reset.

This fix to widgets/QuickZoom.widget.php:

 function GetHTMLHiddenVariables()
    {
        parent::GetHTMLHiddenVariables();

        $szVariable = "NAV_QUICKZOOM";
        $szValue = " <INPUT TYPE=HIDDEN NAME=$szVariable VALUE=\"\">\n";
        $aReturn[$szVariable] = $szValue;

        $szVariable = "SEL_QUICKZOOM";
+       $szVal = "";
+       if ($this->isVarSet( $szVariable ))
+            $szVal = $this->getVar( $szVariable );
+      $szValue = " <INPUT TYPE=HIDDEN NAME=$szVariable
VALUE=\"$szVal\">\n";
        $aReturn[$szVariable] = $szValue;

        return $aReturn;
    }

This seems to fix the problem.  But I'm not sure if this is the correct
way to fix it, or how to ensure that this fix get's into a future
release.


Eric







More information about the Chameleon mailing list