From: Dave Greenberg Date: Wed, 15 Oct 2014 20:00:17 +0000 (-0700) Subject: CRM-15467 - Set location type to is_default and fix group_type in uf_group insert. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a03a3bd74b6442a743c852814d7113849664d5f5;p=civicrm-core.git CRM-15467 - Set location type to is_default and fix group_type in uf_group insert. ---------------------------------------- * CRM-15467: https://issues.civicrm.org/jira/browse/CRM-15467 --- diff --git a/CRM/Upgrade/Incremental/sql/4.5.2.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.5.2.mysql.tpl index 5f07835c2a..e4f828739b 100644 --- a/CRM/Upgrade/Incremental/sql/4.5.2.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.5.2.mysql.tpl @@ -1 +1,5 @@ {* file to handle db changes in 4.5.2 during upgrade *} + +-- CRM-15467 Also fix group_type for Honoree Profile +UPDATE civicrm_uf_group SET group_type = 'Individual,Contact' WHERE name = 'honoree_individual'; + diff --git a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl index 25da57f256..b81810e144 100644 --- a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl @@ -127,9 +127,10 @@ ALTER TABLE civicrm_action_schedule ADD CONSTRAINT FK_civicrm_action_schedule_sm INSERT INTO `civicrm_uf_group` (`name`, `group_type`, {localize field='title'}`title`{/localize}, `is_cms_user`, `is_reserved`) VALUES - ('honoree_individual', 'Individual, Contact', {localize}'{ts escape="sql"}Honoree Individual{/ts}'{/localize}, 0, 1); + ('honoree_individual', 'Individual,Contact', {localize}'{ts escape="sql"}Honoree Individual{/ts}'{/localize}, 0, 1); SELECT @uf_group_id_honoree_individual := id from civicrm_uf_group where name = 'honoree_individual'; +SELECT @primaryLocation := id FROM civicrm_location_type WHERE is_default = 1; INSERT INTO `civicrm_uf_field` (`uf_group_id`, `field_name`, `is_required`, `is_reserved`, `weight`, `visibility`, `in_selector`, `is_searchable`, `location_type_id`, {localize field='label'}`label`{/localize}, field_type) @@ -137,7 +138,7 @@ VALUES (@uf_group_id_honoree_individual, 'prefix_id', 0, 1, 1, 'User and User Admin Only', 0, 1, NULL, {localize}'{ts escape="sql"}Individual Prefix{/ts}'{/localize}, 'Individual'), (@uf_group_id_honoree_individual, 'first_name', 0, 1, 2, 'User and User Admin Only', 0, 1, NULL, {localize}'{ts escape="sql"}First Name{/ts}'{/localize}, 'Individual'), (@uf_group_id_honoree_individual, 'last_name', 0, 1, 3, 'User and User Admin Only', 0, 1, NULL, {localize}'{ts escape="sql"}Last Name{/ts}'{/localize}, 'Individual'), - (@uf_group_id_honoree_individual, 'email', 0, 1, 4, 'User and User Admin Only', 0, 1, 1, {localize}'{ts escape="sql"}Email Address{/ts}'{/localize}, 'Individual'); + (@uf_group_id_honoree_individual, 'email', 0, 1, 4, 'User and User Admin Only', 0, 1, @primaryLocation, {localize}'{ts escape="sql"}Email Address{/ts}'{/localize}, 'Individual'); UPDATE civicrm_uf_join SET uf_group_id = @uf_group_id_honoree_individual WHERE module = 'soft_credit';