diff --git a/extension/Classes/Core/AbstractBuildForm.php b/extension/Classes/Core/AbstractBuildForm.php index 786522b25a1682a2afc6706e2db0f9b8e197eed2..43c104acb077464c8846c364d70ecb958b68a6a6 100644 --- a/extension/Classes/Core/AbstractBuildForm.php +++ b/extension/Classes/Core/AbstractBuildForm.php @@ -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); diff --git a/extension/Classes/Core/Form/Dirty.php b/extension/Classes/Core/Form/Dirty.php index 9f976f3529a9f17ec916903128a3b199eb1ec44e..8f85041af9c9dc2c4420f67ad89a8a02e637fbe5 100644 --- a/extension/Classes/Core/Form/Dirty.php +++ b/extension/Classes/Core/Form/Dirty.php @@ -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);