N°4173 Fix memory_limit error when saving an object pointing to a big AttributeBlob

Check of pointed object was loading the whole object instead of just doing a count
This commit is contained in:
Pierre Goiffon
2021-07-27 15:14:59 +02:00
parent 714294e1b4
commit a66830de17
2 changed files with 12 additions and 8 deletions

View File

@@ -1859,9 +1859,7 @@ abstract class DBObject implements iDisplay
{
/** @var \AttributeExternalKey $oAtt */
$sTargetClass = $oAtt->GetTargetClass();
$oTargetObj = MetaModel::GetObject($sTargetClass, $toCheck, false /*must be found*/, true /*allow all data*/);
if (is_null($oTargetObj))
{
if (false === MetaModel::IsObjectExistsInDb($sTargetClass, $toCheck)) {
return "Target object not found ($sTargetClass::$toCheck)";
}
}