From 0f7e48ea172a38e32d5f2b22af92014c55dee298 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Fri, 1 Apr 2011 18:01:46 +1300 Subject: [PATCH] When an import event has no UID we reluctantly assign one. Signed-off-by: Andrew McMillan --- inc/caldav-PUT-functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/caldav-PUT-functions.php b/inc/caldav-PUT-functions.php index c1e03c34..17e0a7af 100644 --- a/inc/caldav-PUT-functions.php +++ b/inc/caldav-PUT-functions.php @@ -433,7 +433,11 @@ function import_collection( $ics_content, $user_no, $path, $caldav_context, $app $resources = array(); foreach( $components AS $k => $comp ) { $uid = $comp->GetPValue('UID'); - if ( $uid == null || $uid == '' ) continue; + if ( $uid == null || $uid == '' ) { + $uid = uuid(); + $comp->AddProperty('UID',$uid); + dbg_error_log( 'LOG WARN', ' PUT: New collection resource does not have a UID - we assign one!' ); + } if ( !isset($resources[$uid]) ) $resources[$uid] = array(); $resources[$uid][] = $comp;