From 9335cf1158870647f23cd7e6922eef508178a3d5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 28 Nov 2017 13:39:34 +0100 Subject: [sysconfig] Revert contraint to location table: Breaks default config Default config is locationid = 0, which obviously doesn't work with the constraint. Using NULL proves difficult here (dups etc.), so don't for now, and add code to the cron hook that will clean up deleted locations. --- modules-available/sysconfig/hooks/cron.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules-available/sysconfig/hooks') diff --git a/modules-available/sysconfig/hooks/cron.inc.php b/modules-available/sysconfig/hooks/cron.inc.php index d1f91437..d2457685 100644 --- a/modules-available/sysconfig/hooks/cron.inc.php +++ b/modules-available/sysconfig/hooks/cron.inc.php @@ -1,3 +1,8 @@ location where the location has been deleted +Database::exec("DELETE c FROM configtgz_location c + LEFT JOIN location l USING (locationid) + WHERE l.locationid IS NULL"); -- cgit v1.2.3-55-g7522