N°4756 - Ease extensibility for CRUD operations : Protect against update loops

This commit is contained in:
Eric Espie
2022-12-22 08:56:40 +01:00
parent 53091fc5df
commit bdd5741290
2 changed files with 4 additions and 3 deletions

View File

@@ -4440,7 +4440,8 @@ HTML;
MetaModel::StopReentranceProtection(Metamodel::REENTRANCE_TYPE_UPDATE, $this);
}
if ($this->IsModified()) {
$aChanges = $this->ListChanges();
if (count($aChanges) != 0) {
$this->iUpdateLoopCount++;
if ($this->iUpdateLoopCount > self::MAX_UPDATE_LOOP_COUNT) {
$sClass = get_class($this);

View File

@@ -5976,7 +5976,7 @@ abstract class DBObject implements iDisplay
*/
protected function GetExtensionsAttributeFlags(string $sAttCode, array &$aReasons, string $sTargetState): int
{
return 0;
return OPT_ATT_NORMAL;
}
/**
@@ -5988,7 +5988,7 @@ abstract class DBObject implements iDisplay
*/
protected function GetExtensionsInitialStateAttributeFlags(string $sAttCode, array &$aReasons): int
{
return 0;
return OPT_ATT_NORMAL;
}
}