From b1a46b51710d9ec54792b58f6c16b49a43df6be2 Mon Sep 17 00:00:00 2001 From: Carsten Rose Date: Sat, 1 May 2021 14:02:38 +0200 Subject: [PATCH] Fixes #12475 During QFQ update take care that all system tables exist. --- Documentation/CodingGuideline.rst | 2 +- extension/Classes/Core/Database/DatabaseUpdate.php | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/CodingGuideline.rst b/Documentation/CodingGuideline.rst index d5366849..e02e24e6 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 f243bdf9..bce76e10 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); } } -- GitLab