Merge branch 'support/2.6.2'

This commit is contained in:
Pierre Goiffon
2019-10-07 09:41:08 +02:00
2 changed files with 12 additions and 6 deletions

View File

@@ -2178,11 +2178,14 @@ EOF
if ((count($aAllowedValues) == 1) && ($bMandatory == 'true')) if ((count($aAllowedValues) == 1) && ($bMandatory == 'true'))
{ {
// When there is only once choice, select it by default // When there is only once choice, select it by default
if($value != $key)
{
$oPage->add_ready_script( $oPage->add_ready_script(
<<<EOF <<<EOF
$('#$iId').attr('data-validate','dependencies'); $('#$iId').attr('data-validate','dependencies');
EOF EOF
); );
}
$sSelected = ' selected'; $sSelected = ' selected';
} }
else else

View File

@@ -208,12 +208,15 @@ class UIExtKeyWidget
{ {
// When there is only once choice, select it by default // When there is only once choice, select it by default
$sSelected = 'selected'; $sSelected = 'selected';
if($value != $key)
{
$oPage->add_ready_script( $oPage->add_ready_script(
<<<EOF <<<EOF
$('#$this->iId').attr('data-validate','dependencies'); $('#$this->iId').attr('data-validate','dependencies');
EOF EOF
); );
} }
}
else else
{ {
$sSelected = (is_array($value) && in_array($key, $value)) || ($value == $key) ? 'selected' : ''; $sSelected = (is_array($value) && in_array($key, $value)) || ($value == $key) ? 'selected' : '';