From b2a292118b152d74f9d5b9d85c01378ffa11f248 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 3 Nov 2014 11:27:36 +0530 Subject: [PATCH] -- CRM-15475, Added upgrade code to make Cancelled status as reserved ---------------------------------------- * CRM-15475: Fatal error on membership page if membership status 'Cancelled' is disabled https://issues.civicrm.org/jira/browse/CRM-15475 --- CRM/Upgrade/Incremental/sql/4.5.3.mysql.tpl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CRM/Upgrade/Incremental/sql/4.5.3.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.5.3.mysql.tpl index d72265052f..cee9125d6b 100644 --- a/CRM/Upgrade/Incremental/sql/4.5.3.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.5.3.mysql.tpl @@ -1,2 +1,9 @@ {* file to handle db changes in 4.5.3 during upgrade *} +-- CRM-15475 +SELECT @membershipStatusId := id FROM civicrm_membership_status WHERE name = 'Cancelled'; +SELECT @membershipStatusWeight := max(weight) + 1 FROM civicrm_membership_status; + +INSERT INTO civicrm_membership_status (id, name, {localize field='label'}label{/localize}, start_event, start_event_adjust_unit, start_event_adjust_interval, end_event, end_event_adjust_unit, end_event_adjust_interval, is_current_member, is_admin, weight, is_default, is_active, is_reserved) +VALUES (@membershipStatusId, 'Cancelled', {localize}'{ts escape="sql"}Cancelled{/ts}'{/localize}, 'join_date', null, null, 'join_date', null, null, 0, 0, @membershipStatusWeight, 0, 0, 1) +ON DUPLICATE KEY UPDATE is_reserved = 1; \ No newline at end of file -- 2.25.1