From 3fa29a542d42e754c8d06a32e40baab5c36c393d Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 3 Apr 2018 10:52:42 -0600 Subject: [PATCH] Calendar - add update to deal with birthdays_as_events preference staying at FALSE for all users --- calendar/setup/setup.inc.php | 2 +- calendar/setup/tables_update.inc.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/calendar/setup/setup.inc.php b/calendar/setup/setup.inc.php index 7ab41ec552..951ebaf86a 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'] = '17.1'; +$setup_info['calendar']['version'] = '17.1.001'; $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 773bd2b6be..bafffd7981 100644 --- a/calendar/setup/tables_update.inc.php +++ b/calendar/setup/tables_update.inc.php @@ -2754,3 +2754,13 @@ function calendar_upgrade16_1_003() { return $GLOBALS['setup_info']['calendar']['currentver'] = '17.1'; } + +function calendar_upgrade17_1() +{ + // Update birthdays as events preference from boolean + $change = function($attr, $old_value, $owner) { + return $old_value ? 'birthday' : '0'; + }; + Api\Preferences::change_preference('calendar', 'birthdays_as_events', $change); + return $GLOBALS['setup_info']['calendar']['currentver'] = '17.1.001'; +} \ No newline at end of file