When an import event has no UID we reluctantly assign one.

Signed-off-by: Andrew McMillan <andrew@morphoss.com>
This commit is contained in:
Andrew McMillan 2011-04-01 18:01:46 +13:00
parent 1a9d06b470
commit 0f7e48ea17

View File

@ -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;