no more need to set version

This commit is contained in:
Jean-Christian Paul Denis 2022-12-07 23:57:05 +01:00
parent 324f6c470d
commit d2febcdeba
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -14,10 +14,11 @@ if (!defined('DC_CONTEXT_ADMIN')) {
return null; return null;
} }
$new_version = dcCore::app()->plugins->moduleInfo('activityReport', 'version'); if (version_compare(
$old_version = dcCore::app()->getVersion('activityReport'); dcCore::app()->getVersion('activityReport'),
dcCore::app()->plugins->moduleInfo('activityReport', 'version'),
if (version_compare($old_version, $new_version, '>=')) { '>='
)) {
return null; return null;
} }
@ -54,8 +55,6 @@ try {
$si = new dbStruct(dcCore::app()->con, dcCore::app()->prefix); $si = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
$changes = $si->synchronize($s); $changes = $si->synchronize($s);
dcCore::app()->setVersion('activityReport', $new_version);
return true; return true;
} catch (Exception $e) { } catch (Exception $e) {
dcCore::app()->error->add($e->getMessage()); dcCore::app()->error->add($e->getMessage());