N°9160 - Refactor UpdateChildxxxxxLog and test

This commit is contained in:
v-dumas
2026-05-29 17:18:41 +02:00
parent 09ea64e5d5
commit d7ef9acf1a
3 changed files with 14 additions and 7 deletions

View File

@@ -1317,7 +1317,7 @@
<code><![CDATA[ public function UpdateChildRequestLog()
{
if (MetaModel::IsValidClass('UserRequest')) {
return parent::UpdateChildTicketLog('UserRequest', 'parent_request_id', ['public_log', 'private_log']);
return $this->UpdateChildTicketLog('UserRequest', 'parent_incident_id', ['public_log' => 'public_log', 'private_log' => 'private_log'] );
}
return true;
}]]></code>
@@ -1329,7 +1329,7 @@
<type>LifecycleAction</type>
<code><![CDATA[ public function UpdateChildIncidentLog()
{
return parent::UpdateChildTicketLog('Incident', 'parent_incident_id', ['public_log', 'private_log']);
return $this->UpdateChildTicketLog('Incident', 'parent_incident_id', ['public_log' => 'public_log', 'private_log' => 'private_log']);
}]]></code>
</method>
<method id="ComputeImpactedItems">

View File

@@ -1452,8 +1452,17 @@
<type>LifecycleAction</type>
<code><![CDATA[ public function UpdateChildRequestLog()
{
return parent::UpdateChildTicketLog('UserRequest', 'parent_request_id', ['public_log', 'private_log']);
return $this->UpdateChildTicketLog('UserRequest', 'parent_request_id', ['public_log' => 'public_log', 'private_log' => 'private_log' ]);
}]]></code>
</method>
<method id="UpdateChildIncidentLog">
<static>false</static>
<access>public</access>
<type>LifecycleAction</type>
<code><![CDATA[ public function UpdateChildIncidentLog()
{
return $this->UpdateChildTicketLog('Incident', 'parent_request_id', ['public_log' => 'public_log', 'private_log' => 'private_log']);
}]]></code>
</method>
<method id="ComputeImpactedItems">
<static>false</static>
@@ -1490,6 +1499,7 @@
parent::OnUpdate();
$this->Set('last_update', time());
$this->UpdateChildRequestLog();
$this->UpdateChildIncidentLog();
}]]></code>
</method>
</methods>

View File

@@ -1487,10 +1487,7 @@
<type>LifecycleAction</type>
<code><![CDATA[ public function UpdateChildRequestLog()
{
return $this->UpdateChildTicketLog('UserRequest', 'parent_request_id',
['public_log' => 'public_log',
'private_log' => 'private_log',
]);
return $this->UpdateChildTicketLog('UserRequest', 'parent_request_id', ['public_log' => 'public_log', 'private_log' => 'private_log'] );
}]]></code>
</method>
<method id="ComputeImpactedItems">