From e9e6d8f5ab6e37cf1171b0a715a1ddfc27d7f2b8 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 24 Nov 2015 16:38:04 +0000 Subject: [PATCH] Remove dates stored in favorites --- calendar/setup/setup.inc.php | 2 +- calendar/setup/tables_update.inc.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/calendar/setup/setup.inc.php b/calendar/setup/setup.inc.php index e6d720e063..4dbb70ba6f 100755 --- a/calendar/setup/setup.inc.php +++ b/calendar/setup/setup.inc.php @@ -10,7 +10,7 @@ */ $setup_info['calendar']['name'] = 'calendar'; -$setup_info['calendar']['version'] = '14.3.901'; +$setup_info['calendar']['version'] = '14.3.902'; $setup_info['calendar']['app_order'] = 3; $setup_info['calendar']['enable'] = 1; $setup_info['calendar']['index'] = 'calendar.calendar_uiviews.index&ajax=true'; diff --git a/calendar/setup/tables_update.inc.php b/calendar/setup/tables_update.inc.php index c8c2d16ded..7e61014601 100644 --- a/calendar/setup/tables_update.inc.php +++ b/calendar/setup/tables_update.inc.php @@ -2662,3 +2662,20 @@ function calendar_upgrade14_3_900() } return $GLOBALS['setup_info']['calendar']['currentver'] = '14.3.901'; } + +/** + * Remove dates from favorites + * + * @return string New version number + */ +function calendar_upgrade14_3_901() +{ + preferences::change_preference('calendar', '/^favorite_/', function($attr, $old_value, $owner) { + if($old_value['state']) + { + unset($old_value['state']['date']); + } + return $old_value; + }); + return $GLOBALS['setup_info']['calendar']['currentver'] = '14.3.902'; +}