From e29ca14960eabb042627631521cd6db854fdcf0e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 7 Aug 2004 14:19:53 +0000 Subject: [PATCH] fix for bug [ 1004555 ] Database error adding new calendar item: - happend only if participants have been disabled via custom-fields - was caused by the code entering participants from matrixview --- calendar/inc/class.bocalendar.inc.php | 2 +- calendar/inc/class.uicalendar.inc.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/calendar/inc/class.bocalendar.inc.php b/calendar/inc/class.bocalendar.inc.php index a463ee86f1..164019373d 100755 --- a/calendar/inc/class.bocalendar.inc.php +++ b/calendar/inc/class.bocalendar.inc.php @@ -2621,7 +2621,7 @@ { $details[$key] = $val['data']; } - $details['participants'] = implode("\n",$details['participants']); + $details['participants'] = $details['participants'] ? implode("\n",$details['participants']) : ''; $details['link'] = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=calendar.uicalendar.view&cal_id='.$event['id']; // if url is only a path, try guessing the rest ;-) diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php index 4d8ac1ef91..f6abfe5a23 100755 --- a/calendar/inc/class.uicalendar.inc.php +++ b/calendar/inc/class.uicalendar.inc.php @@ -1280,10 +1280,9 @@ $this->bo->set_class(True); } // Add participants from matrixview - $participants = explode(";", $GLOBALS['phpgw']->session->appsession("participants") ); - for($_f_part=0; $_f_partsession->appsession("participants")) as $part) { - $this->bo->add_attribute('participants','U',$participants[$_f_part]); + if ($part) $this->bo->add_attribute('participants','U',$part); } // Add misc $this->bo->add_attribute('participants','A',$this->bo->owner);