summaryrefslogtreecommitdiffstats
path: root/modules-available/locations/inc/autolocation.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-07-31 16:58:14 +0200
committerSimon Rettberg2019-07-31 16:58:14 +0200
commit7c539fd8736b0ff9acafe32d857b2a2021d778e6 (patch)
treeb6a44076cba8443b2840340256b9829451214229 /modules-available/locations/inc/autolocation.inc.php
parent[locations] Optimize some functions in Location class (diff)
downloadslx-admin-7c539fd8736b0ff9acafe32d857b2a2021d778e6.tar.gz
slx-admin-7c539fd8736b0ff9acafe32d857b2a2021d778e6.tar.xz
slx-admin-7c539fd8736b0ff9acafe32d857b2a2021d778e6.zip
[locations] Add warnings/cleanup for bad machine to roomplan mappings
Diffstat (limited to 'modules-available/locations/inc/autolocation.inc.php')
-rw-r--r--modules-available/locations/inc/autolocation.inc.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules-available/locations/inc/autolocation.inc.php b/modules-available/locations/inc/autolocation.inc.php
index 61507ebf..82c61251 100644
--- a/modules-available/locations/inc/autolocation.inc.php
+++ b/modules-available/locations/inc/autolocation.inc.php
@@ -43,6 +43,9 @@ class AutoLocation
Database::exec("UPDATE machine SET subnetlocationid = :lid WHERE machineuuid IN (:machines)",
['lid' => $lid, 'machines' => $machines]);
}
+ // While we're at it, try to fix invalid entries, having a fixedlocationid but no actual position information
+ Database::exec('UPDATE machine SET fixedlocationid = NULL
+ WHERE fixedlocationid IS NOT NULL AND Length(position) = 0');
}
}