From 810755de12e9a463bc8d204f6a7b082643e6369f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 10 Nov 2015 10:57:51 +0000 Subject: [PATCH] remove all category values, which are not comma-separated nummerical ids, as they might give an SQL error and wont work anyway --- calendar/setup/tables_update.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/calendar/setup/tables_update.inc.php b/calendar/setup/tables_update.inc.php index c7e2c044be..6188ece917 100644 --- a/calendar/setup/tables_update.inc.php +++ b/calendar/setup/tables_update.inc.php @@ -2452,6 +2452,12 @@ function calendar_upgrade14_2_003() 'nullable' => False, 'comment' => 'unique id of event(-series)' )); + // remove all category values, which are not comma-separated nummerical ids + // as they might give an SQL error and wont work anyway + if ($GLOBALS['egw_setup']->db->Type == 'mysql') + { + $GLOBALS['egw_setup']->db->query("UPDATE egw_cal SET cal_category='' WHERE cal_category NOT REGEXP '^[0-9,]*$'", __LINE__, __FILE__); + } $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_category',array( 'type' => 'ascii', 'meta' => 'category',