From fc0e5c510ff5b9ff31b5aaf39a5aec3b20550fbf Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 28 Nov 2024 11:07:15 +0100 Subject: [PATCH] Fix upgrade2, migrate_productlot_path() need $user. (#32125) * Fix upgrade2, migrate_productlot_path() need $user. * Fix stan * Revert "Fix stan" This reverts commit 5fff7013d32c8601911833c0f9a12852f787a4cf. * Revert "Fix upgrade2, migrate_productlot_path() need $user." This reverts commit faf40eeab4e9835a84020c253ba221c54679e890. * Fix upgrade2, migrate_productlot_path() need $user. --- htdocs/install/upgrade2.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 507cf9cdc414c..c612d5367f8c4 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4401,6 +4401,11 @@ function migrate_productlot_path() { global $conf, $db, $langs, $user; + if (!is_object($user)) { + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $user = new User($db); // To avoid error during migration + } + print ''; print ''.$langs->trans('MigrationProductLotPath')."
\n";