diff --git a/admin/include/updates.class.php b/admin/include/updates.class.php index 61abdc315..e8718779b 100644 --- a/admin/include/updates.class.php +++ b/admin/include/updates.class.php @@ -554,6 +554,7 @@ class updates deltree(PHPWG_ROOT_PATH.$conf['data_location'].'update'); invalidate_user_cache(true); + conf_update_param('piwigo_installed_version', $upgrade_to); pwg_activity('system', ACTIVITY_SYSTEM_CORE, 'update', array('from_version'=>PHPWG_VERSION, 'to_version'=>$upgrade_to)); if ($step == 2) diff --git a/include/common.inc.php b/include/common.inc.php index 2ab4a2243..3fe9bfab4 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -150,6 +150,16 @@ ImageStdParams::load_from_db(); session_start(); load_plugins(); +if (!isset($conf['piwigo_installed_version'])) +{ + conf_update_param('piwigo_installed_version', PHPWG_VERSION); +} +elseif ($conf['piwigo_installed_version'] != PHPWG_VERSION) +{ + pwg_activity('system', ACTIVITY_SYSTEM_CORE, 'autoupdate', array('from_version'=>$conf['piwigo_installed_version'], 'to_version'=>PHPWG_VERSION)); + conf_update_param('piwigo_installed_version', PHPWG_VERSION); +} + // 2022-02-25 due to escape on "rank" (becoming a mysql keyword in version 8), the $conf['order_by'] might // use a "rank", even if admin/configuration.php should have removed it. We must remove it. // TODO remove this data update as soon as 2025 arrives