This commit is contained in:
root 2025-06-19 14:28:49 +01:00
commit 0dbba014d8
2 changed files with 2 additions and 1 deletions

View File

@ -27,7 +27,7 @@ function handleTriggerExecutionResult($result, $stdout, $stderr, $originalRow, $
}
// Check if the new data differs from the original data
if ($newRowValue !== $originalRow) {
if (json_encode($newRowValue) !== json_encode($originalRow)) {
// Update the database row accordingly
updateDatabaseRow($tableName, $originalRow, $newRowValue);
}

View File

@ -180,6 +180,7 @@ function runJavascriptCodeTrigger($functionName, $activeTable, $row) {
*/
function updateDatabaseRow($tableName, $originalRow, $newRowValue) {
if (empty($originalRow) || empty($newRowValue)) return;
$pkColsName = getTblPrimaryKeyColName($tableName);
$pkColsValues = array_map(fn($cName) => $originalRow[$cName], $pkColsName);