(Retrofit from trunk) N°1025 Portal: Fixed regression introduced in r4863.

SVN:2.4[4982]
This commit is contained in:
Guillaume Lajarige
2017-10-05 15:52:12 +00:00
parent 646972838a
commit c9c84735c4

View File

@@ -714,6 +714,8 @@ class ObjectFormManager extends FormManager
// Note: We can't do this in AttributeExternalKey::MakeFormField() in the Field::SetOnFinalizeCallback() because at this point we have no information about the portal scope and ignore_silos flag, hence it always applies silos. // Note: We can't do this in AttributeExternalKey::MakeFormField() in the Field::SetOnFinalizeCallback() because at this point we have no information about the portal scope and ignore_silos flag, hence it always applies silos.
// As a workaround we have to manually check if the field's current value is among the scope // As a workaround we have to manually check if the field's current value is among the scope
if(!$oField->GetReadOnly())
{
/** @var DBObjectSearch $oValuesScope */ /** @var DBObjectSearch $oValuesScope */
$oValuesScope = $oField->GetSearch()->DeepClone(); $oValuesScope = $oField->GetSearch()->DeepClone();
$oBinaryExp = new BinaryExpression(new FieldExpression('id', $oValuesScope->GetClassAlias()), '=', new ScalarExpression($oField->GetCurrentValue())); $oBinaryExp = new BinaryExpression(new FieldExpression('id', $oValuesScope->GetClassAlias()), '=', new ScalarExpression($oField->GetCurrentValue()));
@@ -724,6 +726,7 @@ class ObjectFormManager extends FormManager
{ {
$oField->SetCurrentValue(null); $oField->SetCurrentValue(null);
} }
}
} }
// - Field that require processing on their subfields // - Field that require processing on their subfields
if (in_array(get_class($oField), array('Combodo\\iTop\\Form\\Field\\SubFormField'))) if (in_array(get_class($oField), array('Combodo\\iTop\\Form\\Field\\SubFormField')))