N°2482 Regression on mandatory external field with only 1 value

This commit is contained in:
Stephen Abello
2019-09-13 10:42:55 +02:00
parent f4d538ef6c
commit 31a34c247c
2 changed files with 12 additions and 6 deletions

View File

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

View File

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