mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Fixes #4609 - Quick fix for inconsistent drop-down behavior PHP7 -> PHP8.
This commit is contained in:
@@ -3487,6 +3487,12 @@ var_dump($select_options);*/
|
||||
|
||||
$opts = $options;
|
||||
|
||||
|
||||
if($selected === array(0=>'')) // quick fix. @see github issue #4609
|
||||
{
|
||||
$selected = 0;
|
||||
}
|
||||
|
||||
foreach ((array) $option_array as $value => $label)
|
||||
{
|
||||
|
||||
@@ -6740,7 +6746,7 @@ var_dump($select_options);*/
|
||||
$eloptions['multiple'] = true;
|
||||
}
|
||||
unset($parms['__options']);
|
||||
if(!empty($eloptions['multiple']) && !is_array($value))
|
||||
if(!empty($eloptions['multiple']) && !is_array($value) && !empty($value))
|
||||
{
|
||||
$value = explode(',', $value);
|
||||
}
|
||||
|
@@ -790,11 +790,11 @@ class e_formTest extends \Codeception\Test\Unit
|
||||
|
||||
);
|
||||
|
||||
foreach($tests as $row)
|
||||
foreach($tests as $index => $row)
|
||||
{
|
||||
$actual = $this->_frm->option_multi($row['options'],$row['value']);
|
||||
$actual = str_replace("\n", '', $actual);
|
||||
$this->assertSame($row['expected'], $actual);
|
||||
$this->assertSame($row['expected'], $actual, 'Test #'.$index.' failed');
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user