diff options
author | Simon Rettberg | 2019-07-31 16:58:14 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-07-31 16:58:14 +0200 |
commit | 7c539fd8736b0ff9acafe32d857b2a2021d778e6 (patch) | |
tree | b6a44076cba8443b2840340256b9829451214229 /modules-available/locations/inc/autolocation.inc.php | |
parent | [locations] Optimize some functions in Location class (diff) | |
download | slx-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.php | 3 |
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'); } } |