Re: QuickForm's date element / addEmptyOption
| From: | Mark Wiesemann | Date: | Sun, 31 Jul 2005 20:46:27 +0000 |
| Subject: | Re: QuickForm's date element / addEmptyOption | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20197@lists.php.net to get a copy of this message | ||
> Justin Patrin wrote:
>
>> What versions of HTML_QuickForm are you using on the 2 machines? Also,
>> what versions of PHP?
>
> QF version is 3.2.4pl1. I have copied my local PEAR installation to the
> webserver, so all PEAR files have the same version on both machines.
>
> PHP versions:
> - local 4.3.7 ( WAMP) / working as expected)
> - webserver 4.3.10 (LAMP) / empty option at the end of the lists
I did some further tests on a third machine: LAMP, PHP 5.0.3, same PEAR
files and unfortunately the same, wrong and wired behaviour. :-(
But: I debugged QF's code and it is this line (around 350) in date.php
that causes the problem:
$options = array($this->_options['emptyOptionValue'] =>
this->_options['emptyOptionText']) + $options;
When I replace this line with the following lines then I get the right
order:
$old_options = $options;
$options = array($this->_options['emptyOptionValue'] =>
$this->_options['emptyOptionText']);
foreach ($old_options as $key => $value) {
$options[$key] = $value;
}
As this still preserves the array keys and it works perfectly on all
three machines - is this worth opening a bug report / feature request?
Mark