Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(mqtt): connection to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
btry authored and DIOHz0r committed Nov 24, 2017
1 parent 8333fab commit 10d67d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 0 additions & 2 deletions install/installer.class.php
Expand Up @@ -110,7 +110,6 @@ public function install() {
$this->migration->displayWarning("Error creating tables : " . $DB->error(), true);
return false;
}

$this->createInitialConfig();
} else {
if ($this->endsWith(PLUGIN_FLYVEMDM_VERSION, "-dev") || (version_compare(self::getCurrentVersion(), PLUGIN_FLYVEMDM_VERSION) != 0)) {
Expand Down Expand Up @@ -509,7 +508,6 @@ protected function upgradeOneStep($toVersion) {
if (function_exists($updateFunction)) {
$this->migration->addNewMessageArea("Upgrade to $toVersion");
$updateFunction($this->migration);
$this->migration->executeMigration();
$this->migration->displayMessage('Done');
}
}
Expand Down
11 changes: 10 additions & 1 deletion install/upgrade/update_to_dev.php
Expand Up @@ -181,7 +181,16 @@ function plugin_flyvemdm_update_to_dev(Migration $migration) {
$migration->addfield($table, 'plugin_orion_tasks_id', 'integer', ['after' => 'dl_filename']);
$migration->addKey($table, 'entities_id', 'entities_id');
$migration->addPostQuery("UPDATE `$table` SET `parse_status` = 'parsed'");
$migration->addPostQuery("UPDATE `$table` SET `filename` = CONCAT('" . addslashes(GLPI_DOC_DIR) . "', `filename`)");

$result = $DB->request(['FROM' => $table, 'LIMIT' => '1']);
if ($result->count() > 0) {
$result->rewind();
$row = $result->current();
if (strpos($row['filename'], 'flyvemdm/package/') !== 0) {
// It there is at least one package and the path does st arts with the new prefix, then update all the table
$migration->addPostQuery("UPDATE `$table` SET `filename` = CONCAT('flyvemdm/package/', `filename`)");
}
}

$table = 'glpi_plugin_flyvemdm_files';
$migration->addKey($table, 'entities_id', 'entities_id');
Expand Down

0 comments on commit 10d67d2

Please sign in to comment.