diff --git a/plt/handleTriggerExecutionResult.inc.php b/plt/handleTriggerExecutionResult.inc.php index 0ea3917..063b4f1 100644 --- a/plt/handleTriggerExecutionResult.inc.php +++ b/plt/handleTriggerExecutionResult.inc.php @@ -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); } diff --git a/plt/index.php b/plt/index.php index ac60f3d..e29bf9a 100755 --- a/plt/index.php +++ b/plt/index.php @@ -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);