diff options
author | Simon Rettberg | 2017-01-11 12:19:20 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-01-11 12:19:20 +0100 |
commit | a0e43d9fb99f65c0f6c9357d9fbaccab36deec5a (patch) | |
tree | 51b2ea1cb42b7451c2528132390eb07e2a06fc36 /modules-available/statistics/install.inc.php | |
parent | [baseconfig_bwlp] Update translations (diff) | |
download | slx-admin-a0e43d9fb99f65c0f6c9357d9fbaccab36deec5a.tar.gz slx-admin-a0e43d9fb99f65c0f6c9357d9fbaccab36deec5a.tar.xz slx-admin-a0e43d9fb99f65c0f6c9357d9fbaccab36deec5a.zip |
[statistics/locations] Update/set subnetlocationid field in DB if the DB has been updated
Diffstat (limited to 'modules-available/statistics/install.inc.php')
-rw-r--r-- | modules-available/statistics/install.inc.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules-available/statistics/install.inc.php b/modules-available/statistics/install.inc.php index 0729d676..7baf046e 100644 --- a/modules-available/statistics/install.inc.php +++ b/modules-available/statistics/install.inc.php @@ -155,6 +155,14 @@ if ($addTrigger) { if ($ret === false) { finalResponse(UPDATE_FAILED, 'Adding locationid trigger to machine failed: ' . Database::lastError()); } + // This might be an update - calculate all subnetlocationid values (if location module is installed yet) + if (Module::isAvailable('locations')) { + if (tableExists('subnet')) { + AutoLocation::rebuildAll(); + } else { + finalResponse(UPDATE_RETRY, 'Locations module not installed yet, retry later'); + } + } } // Create response |