diff --git a/Documentation/CodingGuideline.rst b/Documentation/CodingGuideline.rst index d5366849dd39f027af0c57412d34c04dc3af46ca..e02e24e6a06ce01ff58c5ee6d200341f292f1fd7 100644 --- a/Documentation/CodingGuideline.rst +++ b/Documentation/CodingGuideline.rst @@ -81,7 +81,7 @@ QFQ content record QFQ Form -------- -* Mandatory SIP parameter have to be mentioned in Form.requiredNew and/or Form.requiredEdit. +* Mandatory SIP parameter should to be mentioned in Form.requiredNew and/or Form.requiredEdit. * If the title of a FormElement isn't descriptive enough, use tooltip, note or extraButtonInfo to explain to a user. * Every Form should show a descriptive title to identify the task and current record. E.g. Not 'Person' but 'Person: John Doe'. * Often the length of a pill title if not sufficient, use a tooltip to give a more descriptive hint. diff --git a/extension/Classes/Core/Database/DatabaseUpdate.php b/extension/Classes/Core/Database/DatabaseUpdate.php index f243bdf979cdd8fb26b57e2c3533d99e0cf2dec5..bce76e104cd43e4ffc295ce9740bac1bb6cac29d 100644 --- a/extension/Classes/Core/Database/DatabaseUpdate.php +++ b/extension/Classes/Core/Database/DatabaseUpdate.php @@ -156,8 +156,6 @@ class DatabaseUpdate { $versionInfo[QFQ_VERSION_KEY_FUNCTION_VERSION] = $new; } - $this->dbUpdateStatements($old, $new); - if (FEATURE_FORM_FILE_SYNC) { if ($this->db->existTable('Form')) { // If Form table exists, import all form files so everything is up to date. @@ -165,11 +163,11 @@ class DatabaseUpdate { // create Form table and export all system forms $this->db->playSqlFile(__DIR__ . '/../../Sql/formEditor.sql'); - FormAsFIle::exportAllForms($this->db); + FormAsFile::exportAllForms($this->db); } else { // If not, then create Form table and export all system forms $this->db->playSqlFile(__DIR__ . '/../../Sql/formEditor.sql'); - FormAsFIle::exportAllForms($this->db); + FormAsFile::exportAllForms($this->db); // import form files which existed before the new installation FormAsFile::importAllForms($this->db, true); @@ -178,6 +176,10 @@ class DatabaseUpdate { $this->db->playSqlFile(__DIR__ . '/../../Sql/formEditor.sql'); } + // Perform dbUpdate only after formEditor.sql has been played: + // in case a new system table has been added between old and new and there is an dbUpdate on the new system table now. + $this->dbUpdateStatements($old, $new); + FormAsFile::importSystemForms($this->db); Logger::logMessage(date('Y.m.d H:i:s ') . ": Updated from QFQ version '$old' to '$new'", Path::absoluteQfqLogFile()); @@ -195,7 +197,7 @@ class DatabaseUpdate { if (version_compare($old, '19.9.0') === -1) { $this->updateSpecialColumns(); if (FEATURE_FORM_FILE_SYNC) { - FormAsFIle::exportAllForms($this->db); + FormAsFile::exportAllForms($this->db); } }