Commit 6267461b authored by Marc Egger's avatar Marc Egger

Refs #10120 DatbaseUpdate.php: Move form as file code before version number update

parent f4cfb74a
Pipeline #3657 passed with stages
in 4 minutes and 29 seconds
......@@ -153,27 +153,28 @@ class DatabaseUpdate {
$this->dbUpdateStatements($old, $new);
if ($old !== false) {
// Import files from form path. (Creates path and exports all forms to it, if it doesn't exist)
// If Form table exists, import all form files so everything is up to date.
// Note: Creates path and exports all forms to it, if it doesn't exist
FormAsFile::importAllForms($this->db, true, true);
}
$this->db->playSqlFile(__DIR__ . '/../../Sql/formEditor.sql');
$qfqLog = $this->db->getQfqLogFile();
Logger::logMessage(date('Y.m.d H:i:s ') . ": Updated from QFQ version '$old' to '$new'", $qfqLog);
// Finally write the latest version number.
$versionInfo[QFQ_VERSION_KEY] = $new;
$this->setDatabaseVersion($versionInfo);
if ($old === false) {
// new installation: export native forms + import existing user forms
// new installation: export native qfq forms + import existing user forms
FormAsFIle::exportAllForms($this->db, false);
FormAsFile::importAllForms($this->db);
} else {
// Export forms + delete files which were removed since the import above
// Existing installation: export forms + delete files which were removed since the import above
FormAsFIle::exportAllForms($this->db, true);
}
$qfqLog = $this->db->getQfqLogFile();
Logger::logMessage(date('Y.m.d H:i:s ') . ": Updated from QFQ version '$old' to '$new'", $qfqLog);
// Finally write the latest version number.
$versionInfo[QFQ_VERSION_KEY] = $new;
$this->setDatabaseVersion($versionInfo);
}
if ($old === false) {
......
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