Avoid empty tags (#2496)
This commit is contained in:
parent
7131c802ef
commit
0bd01c80f5
2 changed files with 6 additions and 1 deletions
|
@ -598,7 +598,7 @@ class tasklist_kolab_driver extends tasklist_driver
|
|||
'title' => $record['title'],
|
||||
# 'location' => $record['location'],
|
||||
'description' => $record['description'],
|
||||
'tags' => (array)$record['categories'],
|
||||
'tags' => array_filter((array)$record['categories']),
|
||||
'flagged' => $record['priority'] == 1,
|
||||
'complete' => $record['status'] == 'COMPLETED' ? 1 : floatval($record['complete'] / 100),
|
||||
'parent_id' => $record['parent_id'],
|
||||
|
|
|
@ -400,6 +400,11 @@ class tasklist extends rcube_plugin
|
|||
}
|
||||
}
|
||||
|
||||
// convert tags to array, filter out empty entries
|
||||
if (isset($rec['tags']) && !is_array($rec['tags'])) {
|
||||
$rec['tags'] = array_filter((array)$rec['tags']);
|
||||
}
|
||||
|
||||
// alarms cannot work without a date
|
||||
if ($rec['alarms'] && !$rec['date'] && !$rec['startdate'] && strpos($rec['alarms'], '@') === false)
|
||||
$rec['alarms'] = '';
|
||||
|
|
Loading…
Add table
Reference in a new issue