Skip to content

Commit 90727ae

Browse files
committed
fix(issue): repopulate table on upgrade
counters were improved and data in the table must be rebuild Signed-off-by: Thierry Bugier <[email protected]>
1 parent a7c7f1a commit 90727ae

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

install/install.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ class PluginFormcreatorInstall {
6363
'2.7' => '2.8',
6464
'2.8' => '2.8.1',
6565
'2.8.1' => '2.9',
66-
'2.9' => '2.10'
66+
'2.9' => '2.10',
67+
'2.10' => '2.10.2',
6768
];
6869

6970
/**

install/upgrade_to_2.10.2.php

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/**
3+
* ---------------------------------------------------------------------
4+
* Formcreator is a plugin which allows creation of custom forms of
5+
* easy access.
6+
* ---------------------------------------------------------------------
7+
* LICENSE
8+
*
9+
* This file is part of Formcreator.
10+
*
11+
* Formcreator is free software; you can redistribute it and/or modify
12+
* it under the terms of the GNU General Public License as published by
13+
* the Free Software Foundation; either version 2 of the License, or
14+
* (at your option) any later version.
15+
*
16+
* Formcreator is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
* GNU General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU General Public License
22+
* along with Formcreator. If not, see <http://www.gnu.org/licenses/>.
23+
* ---------------------------------------------------------------------
24+
* @copyright Copyright © 2011 - 2019 Teclib'
25+
* @license http://www.gnu.org/licenses/gpl.txt GPLv3+
26+
* @link https://github.com/pluginsGLPI/formcreator/
27+
* @link https://pluginsglpi.github.io/formcreator/
28+
* @link http://plugins.glpi-project.org/#/plugin/formcreator
29+
* ---------------------------------------------------------------------
30+
*/
31+
class PluginFormcreatorUpgradeTo2_10_2 {
32+
33+
protected $migration;
34+
35+
/**
36+
* @param Migration $migration
37+
*/
38+
public function upgrade(Migration $migration) {
39+
global $DB;
40+
41+
$this->migration = $migration;
42+
43+
// Versioin 2.10.2 contains fixes on counters requiring repopulation of issues table
44+
$table = 'glpi_plugin_formcreator_issues';
45+
$DB->query("TRUNCATE `$table`");
46+
PluginFormcreatorIssue::cronSyncIssues(new CronTask());
47+
}
48+
}

0 commit comments

Comments
 (0)