diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index a2a02ae417..e76e2f4a95 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -1604,6 +1604,7 @@ class infolog_ui $parent = $this->bo->so->data; $content['info_id'] = $info_id = 0; $content['info_uid'] = ''; // ensure that we have our own UID + $content['caldav_name'] = ''; // ensure that we have our own caldav_name $content['info_owner'] = $this->user; $content['info_id_parent'] = $parent['info_id']; /* diff --git a/infolog/setup/setup.inc.php b/infolog/setup/setup.inc.php index ecfc5e4ba8..0833543d53 100755 --- a/infolog/setup/setup.inc.php +++ b/infolog/setup/setup.inc.php @@ -12,7 +12,7 @@ */ $setup_info['infolog']['name'] = 'infolog'; -$setup_info['infolog']['version'] = '1.9.002'; +$setup_info['infolog']['version'] = '1.9.003'; $setup_info['infolog']['app_order'] = 5; $setup_info['infolog']['tables'] = array('egw_infolog','egw_infolog_extra'); $setup_info['infolog']['enable'] = 1; diff --git a/infolog/setup/tables_update.inc.php b/infolog/setup/tables_update.inc.php index 54ea43e285..1088396718 100644 --- a/infolog/setup/tables_update.inc.php +++ b/infolog/setup/tables_update.inc.php @@ -679,4 +679,27 @@ function infolog_upgrade1_9_001() )); return $GLOBALS['setup_info']['infolog']['currentver'] = '1.9.002'; +} + + +/** + * Fix caldav_name of subentries is identical with parent + */ +function infolog_upgrade1_9_002() +{ + $ids = array(); + foreach($GLOBALS['egw_setup']->db->query('SELECT sub.info_id +FROM egw_infolog sub +JOIN egw_infolog parent ON sub.info_id_parent=parent.info_id +WHERE parent.caldav_name=sub.caldav_name',__LINE__,__FILE__) as $row) + { + $ids[] = $row['info_id']; + } + if ($ids) + { + $GLOBALS['egw_setup']->db->query('UPDATE egw_infolog SET caldav_name='. + $GLOBALS['egw_setup']->db->concat('info_id',"'.ics'"). + ' WHERE info_id IN ('.implode(',',$ids).')',__LINE__,__FILE__); + } + return $GLOBALS['setup_info']['infolog']['currentver'] = '1.9.003'; } \ No newline at end of file