mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
(Retrofit from trunk) N°1025 Portal: Fixed regression introduced in r4863.
SVN:2.4[4982]
This commit is contained in:
@@ -714,16 +714,19 @@ 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()));
|
||||||
$oValuesScope->AddConditionExpression($oBinaryExp);
|
$oValuesScope->AddConditionExpression($oBinaryExp);
|
||||||
$oValuesSet = new DBObjectSet($oValuesScope);
|
$oValuesSet = new DBObjectSet($oValuesScope);
|
||||||
|
|
||||||
if( $oValuesSet->Count() === 0 )
|
if($oValuesSet->Count() === 0)
|
||||||
{
|
{
|
||||||
$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')))
|
||||||
|
|||||||
Reference in New Issue
Block a user