Commit fa567ff2 authored by Marc Egger's avatar Marc Egger
Browse files

Fixes #11865 : ignore column 'fileStats' when computing md5 hash

parent c36b513d
Pipeline #4879 passed with stages
in 8 minutes and 33 seconds
......@@ -10,6 +10,7 @@ namespace IMATHUZH\Qfq\Core;
use IMATHUZH\Qfq\Core\Database\Database;
use IMATHUZH\Qfq\Core\Form\Checkbox;
use IMATHUZH\Qfq\Core\Form\FormAsFile;
use IMATHUZH\Qfq\Core\Helper\HelperFile;
use IMATHUZH\Qfq\Core\Helper\HelperFormElement;
use IMATHUZH\Qfq\Core\Helper\KeyValueStringParser;
......@@ -556,7 +557,12 @@ abstract class AbstractBuildForm {
$record = array();
if ($recordId != 0) {
$record = $this->dbArray[$this->dbIndexData]->sql("SELECT * FROM `$tableName` WHERE `$primaryKey`=?", ROW_EXPECT_1, [$recordId], "Record to load not found.");
$record = $this->dbArray[$this->dbIndexData]->sql("SELECT * FROM `$tableName` WHERE `$primaryKey`=?", ROW_EXPECT_1, [$recordId], "Record to load not found. " . FormAsFile::errorHintFormImport($tableName));
}
if (isset($record[F_FILE_STATS])) {
// why: The column "fileStats" in the Form table is modified when a form is exported to a file but nothing else changes.
unset($record[F_FILE_STATS]);
}
return OnArray::getMd5($record);
......
......@@ -322,6 +322,11 @@ class Dirty {
$record = $this->dbArray[$this->dbIndexData]->sql("SELECT * FROM `$tableName` WHERE `$primaryKey`=?", ROW_EXPECT_1, [$recordId], "Record to lock not found. " . FormAsFile::errorHintFormImport($tableName));
if (isset($record[F_FILE_STATS])) {
// why: The column "fileStats" in the Form table is modified when a form is exported to a file but nothing else changes.
unset($record[F_FILE_STATS]);
}
$rcMd5 = OnArray::getMd5($record);
return ($recordHashMd5 != $rcMd5);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment