Skip to content

Commit

Permalink
Fixed the upgrade process
Browse files Browse the repository at this point in the history
  • Loading branch information
WillyXJ committed Apr 19, 2017
1 parent 0150914 commit 907423f
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 107 deletions.
4 changes: 4 additions & 0 deletions server/fm-modules/facileManager/change.log
@@ -1,3 +1,7 @@
3.0-?? (2017-??-??)
======================
* Server - [bug] Fixed the upgrade process.

3.0-beta2 (2017-04-14)
======================
* Server - [improvement] Reworked the search bar for easier usage of it.
Expand Down
4 changes: 2 additions & 2 deletions server/fm-modules/facileManager/classes/class_tools.php
Expand Up @@ -62,7 +62,7 @@ function installModule($module_name = null) {
* @since 1.0
* @package facileManager
*/
function upgradeModule($module_name = null, $process = 'noisy') {
function upgradeModule($module_name = null, $process = 'noisy', $running_version = null) {
global $fmdb;

if (!$module_name) {
Expand All @@ -78,7 +78,7 @@ function upgradeModule($module_name = null, $process = 'noisy') {

$function = 'upgrade' . $module_name . 'Schema';
if (function_exists($function)) {
$output = $function($module_name);
$output = $function($running_version);
}
if ($output !== true) {
if ($process == 'quiet') return false;
Expand Down
7 changes: 3 additions & 4 deletions server/fm-modules/facileManager/functions.php
Expand Up @@ -1342,7 +1342,7 @@ function getOption($option = null, $account_id = 0, $module_name = null) {
$query = "SELECT * FROM fm_options WHERE option_name='$option' AND account_id=$account_id $module_sql LIMIT 1";
$fmdb->get_results($query);

if ($fmdb->num_rows) {
if ($fmdb->num_rows && !$fmdb->sql_errors) {
$results = $fmdb->last_result;

if (isSerialized($results[0]->option_value)) {
Expand Down Expand Up @@ -1387,11 +1387,10 @@ function setOption($option = null, $value = null, $insert_update = 'auto', $auto
}
$query = "INSERT INTO fm_options (" . implode(',', $keys) . ") VALUES ('" . implode("','", $values) . "')";
} else {
$query = "UPDATE fm_options SET option_name='$option', option_value='$value' WHERE option_name='$option' AND account_id=$account_id $module_sql";
$query = "UPDATE fm_options SET option_value='$value' WHERE option_name='$option' AND account_id=$account_id $module_sql";
}
$result = $fmdb->query($query);

return $result;
return $fmdb->query($query);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion server/fm-modules/facileManager/upgrade.php
Expand Up @@ -67,7 +67,7 @@ function fmUpgrade($database) {
$module_list = $fmdb->last_result;
for ($x=0; $x<$num_rows; $x++) {
$module_name = $module_list[$x]->module_name;
$success = $fm_tools->upgradeModule($module_name, 'quiet');
$success = $fm_tools->upgradeModule($module_name, 'quiet', $module_list[$x]->option_value);
if (!$success || $fmdb->last_error) {
$errors = true;
$success = false;
Expand Down
4 changes: 4 additions & 0 deletions server/fm-modules/fmDNS/change.log
@@ -1,3 +1,7 @@
3.0-?? (2017-??-??)
======================
* Server - [bug] Fixed the upgrade process.

3.0-beta2 (2017-04-14)
======================
* Server - [feature] Added support to automatically generate a DS RR. (Issue #285)
Expand Down

0 comments on commit 907423f

Please sign in to comment.