Portal: Some fields were no longer mandatory due to a regression introduced by the flags on lifecycle

SVN:trunk[4826]
This commit is contained in:
Guillaume Lajarige
2017-07-10 15:48:50 +00:00
parent 68ac5d7300
commit 97e6c53add

View File

@@ -628,17 +628,21 @@ class ObjectFormManager extends FormManager
}
else
{
// Normal field
$oField->SetReadOnly(false);
$oField->SetHidden(false);
$oField->SetMandatory(false);
// Normal field, use "flags" set by AttDef::MakeFormField()
// Except if we are in a transition be cause $oAttDef doesn't know if the form is for a transition
if($this->IsTransitionForm())
{
$oField->SetReadOnly(false);
$oField->SetHidden(false);
$oField->SetMandatory(false);
}
}
// Finally, if it's mandatory ...
if (($iFieldFlags & OPT_ATT_MANDATORY) === OPT_ATT_MANDATORY)
{
// ... and when in a transition, we force it as mandatory
if($this->IsTransitionForm())
if($this->IsTransitionForm() && $oAttDef->IsNull($this->oObject->Get($sAttCode)))
{
$oField->SetMandatory(true);
}