Skip to content

Commit

Permalink
fix(install): bad sql for upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: btry <tbugier@teclib.com>
  • Loading branch information
btry committed Aug 27, 2018
1 parent a4b9899 commit 73b4515
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions install/update_2.6_2.7.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ function plugin_formcreator_update_2_7(Migration $migration) {
foreach ($DB->request($request) as $row) {
$values = html_entity_decode($row['values']);
$defaultValues = html_entity_decode($row['default_values']);
$DB->query("UDATE `glpi_plugin_formcreator_questions` SET `values` = '$values', `default_values` = '$defaultValues'");
$id = $row['id'];
$DB->query("UPDATE `glpi_plugin_formcreator_questions` SET `values` = '$values', `default_values` = '$defaultValues' WHERE `id` = '$id'");
}

// decode html entities in name of questions
foreach ($DB->request(['FROM' => 'glpi_plugin_formcreator_questions']) as $row) {
$name = html_entity_decode($row['name']);
$DB->query("UPDATE `glpi_plugin_formcreator_questions` SET `name`='$name'");
$id = $row['id'];
$DB->query("UPDATE `glpi_plugin_formcreator_questions` SET `name`='$name' WHERE `id` = '$id'");
}

}
4 changes: 2 additions & 2 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

global $CFG_GLPI;
// Version of the plugin
define('PLUGIN_FORMCREATOR_VERSION', '2.6.4');
define('PLUGIN_FORMCREATOR_VERSION', 'develop');
// Schema version of this version
define('PLUGIN_FORMCREATOR_SCHEMA_VERSION', '2.6');
define('PLUGIN_FORMCREATOR_SCHEMA_VERSION', '2.7');
// is or is not an official release of the plugin
define('PLUGIN_FORMCREATOR_IS_OFFICIAL_RELEASE', false);

Expand Down

0 comments on commit 73b4515

Please sign in to comment.