diff options
author | Simon Rettberg | 2016-10-24 17:13:30 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-10-24 17:13:30 +0200 |
commit | 648eb24336eadab055be07ca48da6d76b6882bc8 (patch) | |
tree | 636c17502f47ead19b4ba34e0fe952d8b1c4bd42 /modules-available/sysconfig | |
parent | [statistics] Fix cache lookup of device pciid (diff) | |
download | slx-admin-648eb24336eadab055be07ca48da6d76b6882bc8.tar.gz slx-admin-648eb24336eadab055be07ca48da6d76b6882bc8.tar.xz slx-admin-648eb24336eadab055be07ca48da6d76b6882bc8.zip |
[sysconfig] Fix query when setting room config-module to "inherit"
Diffstat (limited to 'modules-available/sysconfig')
-rw-r--r-- | modules-available/sysconfig/page.inc.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules-available/sysconfig/page.inc.php b/modules-available/sysconfig/page.inc.php index 511cc3e4..e9fcdee9 100644 --- a/modules-available/sysconfig/page.inc.php +++ b/modules-available/sysconfig/page.inc.php @@ -348,8 +348,13 @@ class Page_SysConfig extends Page } } $locationid = $this->currentLoc; - Database::exec("INSERT INTO configtgz_location (locationid, configid) VALUES (:locationid, :configid)" - . " ON DUPLICATE KEY UPDATE configid = :configid", compact('locationid', 'configid')); + if ($configid === 0) { + Database::exec("DELETE FROM configtgz_location WHERE locationid = :locationid", + compact('locationid')); + } else { + Database::exec("INSERT INTO configtgz_location (locationid, configid) VALUES (:locationid, :configid)" + . " ON DUPLICATE KEY UPDATE configid = :configid", compact('locationid', 'configid')); + } Util::redirect('?do=sysconfig&locationid=' . $this->currentLoc); } |