Skip to content

Commit 5cbcd2d

Browse files
committed
feat(install): find old plugin version
1 parent b80a96e commit 5cbcd2d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

setup.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@
5555
* @return Array [name, version, author, homepage, license, minGlpiVersion]
5656
*/
5757
function plugin_version_formcreator() {
58+
$plugin = new Plugin();
59+
$plugin->getFromDBbyDir('formcreator');
60+
$oldVersion = $plugin->fields['version'];
61+
if ($oldVersion != PLUGIN_FORMCREATOR_VERSION) {
62+
Config::setConfigurationValues('formcreator', [
63+
'previous_version' => $oldVersion,
64+
]);
65+
}
66+
5867
$glpiVersion = rtrim(GLPI_VERSION, '-dev');
5968
if (!method_exists('Plugins', 'checkGlpiVersion') && version_compare($glpiVersion, PLUGIN_FORMCREATOR_GLPI_MIN_VERSION, 'lt')) {
6069
echo 'This plugin requires GLPI >= ' . PLUGIN_FORMCREATOR_GLPI_MIN_VERSION;

0 commit comments

Comments
 (0)