From 21b5eb7b82a8a50f2d0ceb0d6a6f6f4e1522416f Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Tue, 1 Apr 2025 20:45:46 +0200 Subject: [PATCH] Debug migrate using the database flag --- htdocs/install/upgrade2.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 1d2dfa6bb7f..22b88fc2b01 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -5081,15 +5081,18 @@ function migrate_invoice_export_models() $lock = getDolGlobalInt('MIGRATION_INVOICE_MODELS_V20'); $firstInstallVersion = getDolGlobalString('MAIN_VERSION_FIRST_INSTALL', DOL_VERSION); - $migrationNeeded = versioncompare(explode('.', $firstInstallVersion, 3), array(20, 0, -5)) < 0 && !file_exists($lock); + $migrationNeeded = (versioncompare(explode('.', $firstInstallVersion, 3), array(20, 0, -5)) < 0 && !$lock); + + print ''; + print ''.$langs->trans('InvoiceExportModelsMigration').": \n"; if (! $migrationNeeded) { + print $langs->trans("AlreadyDone"); + print ''; dolibarr_set_const($db, 'MIGRATION_INVOICE_MODELS_V20', 1, 'chaine', 0, 'To flag the upgrade of invoice template has been set', 0); return; } - print ''; - print ''.$langs->trans('InvoiceExportModelsMigration')."
\n"; $db->begin(); @@ -5133,7 +5136,7 @@ function migrate_invoice_export_models() $db->commit(); - touch($lock); + dolibarr_set_const($db, 'MIGRATION_INVOICE_MODELS_V20', 1, 'chaine', 0, 'To flag the upgrade of invoice template has been set', 0); echo ''; }