From 5d4300eaad5b200811c0651ecf29fca002e249e7 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 21 Jun 2020 16:43:21 +1000 Subject: [PATCH] dev/core#1833 Change default value of participant_listing_id to NULL from 0 --- CRM/Event/DAO/Event.php | 4 ++-- CRM/Upgrade/Incremental/sql/5.28.alpha1.mysql.tpl | 4 ++++ api/v3/examples/Event/ContactRefCustomField.ex.php | 1 - api/v3/examples/Event/Create.ex.php | 1 - api/v3/examples/Event/Get.ex.php | 1 - api/v3/examples/Event/IsCurrentOption.ex.php | 1 - api/v3/examples/Event/IsFullOption.ex.php | 1 - api/v3/examples/Participant/NestedEventGet.ex.php | 1 - xml/schema/Event/Event.xml | 2 +- 9 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CRM/Event/DAO/Event.php b/CRM/Event/DAO/Event.php index 3c0270b29a..a4713572e5 100644 --- a/CRM/Event/DAO/Event.php +++ b/CRM/Event/DAO/Event.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Event/Event.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7d58a760f7733cbb24b8e49ba31825af) + * (GenCodeChecksum:2393c957679f1dc404df661e3575b4c5) */ /** @@ -645,7 +645,7 @@ class CRM_Event_DAO_Event extends CRM_Core_DAO { 'title' => ts('Participant Listing'), 'description' => ts('Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing.'), 'where' => 'civicrm_event.participant_listing_id', - 'default' => '0', + 'default' => 'NULL', 'table_name' => 'civicrm_event', 'entity' => 'Event', 'bao' => 'CRM_Event_BAO_Event', diff --git a/CRM/Upgrade/Incremental/sql/5.28.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.28.alpha1.mysql.tpl index 13a26cf3e6..bb5e5c9895 100644 --- a/CRM/Upgrade/Incremental/sql/5.28.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/5.28.alpha1.mysql.tpl @@ -14,3 +14,7 @@ ALTER TABLE civicrm_contact_type CHANGE is_active is_active tinyint DEFAULT 1 C ALTER TABLE civicrm_contact_type CHANGE is_reserved is_reserved tinyint DEFAULT 0 COMMENT 'Is this contact type a predefined system type'; UPDATE civicrm_contact_type SET is_active = 1 WHERE is_active IS NULL; UPDATE civicrm_contact_type SET is_reserved = 0 WHERE is_reserved IS NULL; + +-- https://lab.civicrm.org/dev/core/-/issues/1833 +ALTER TABLE civicrm_event CHANGE participant_listing_id participant_listing_id int unsigned DEFAULT NULL COMMENT 'Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing.'; +UPDATE civicrm_event SET participant_listing_id = NULL WHERE participant_listing_id = 0; diff --git a/api/v3/examples/Event/ContactRefCustomField.ex.php b/api/v3/examples/Event/ContactRefCustomField.ex.php index a492401dee..5fe5f62f35 100644 --- a/api/v3/examples/Event/ContactRefCustomField.ex.php +++ b/api/v3/examples/Event/ContactRefCustomField.ex.php @@ -52,7 +52,6 @@ function event_get_expectedresult() { 'event_title' => 'My test event.', 'event_description' => '', 'event_type_id' => '1', - 'participant_listing_id' => 0, 'is_public' => '1', 'start_date' => '2013-07-29 00:00:00', 'event_start_date' => '2013-07-29 00:00:00', diff --git a/api/v3/examples/Event/Create.ex.php b/api/v3/examples/Event/Create.ex.php index ccca91dcce..7f79b3a257 100644 --- a/api/v3/examples/Event/Create.ex.php +++ b/api/v3/examples/Event/Create.ex.php @@ -63,7 +63,6 @@ function event_create_expectedresult() { 'summary' => 'If you have any CiviCRM related issues or want to track where CiviCRM is heading, Sign up now', 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues', 'event_type_id' => '1', - 'participant_listing_id' => '', 'is_public' => '1', 'start_date' => '2013-07-29 00:00:00', 'end_date' => '2013-08-04 00:00:00', diff --git a/api/v3/examples/Event/Get.ex.php b/api/v3/examples/Event/Get.ex.php index 5eb8a9e871..aee29dd29b 100644 --- a/api/v3/examples/Event/Get.ex.php +++ b/api/v3/examples/Event/Get.ex.php @@ -50,7 +50,6 @@ function event_get_expectedresult() { 'event_title' => 'Annual CiviCRM meet', 'event_description' => '', 'event_type_id' => '1', - 'participant_listing_id' => 0, 'is_public' => '1', 'start_date' => '2013-07-29 00:00:00', 'event_start_date' => '2013-07-29 00:00:00', diff --git a/api/v3/examples/Event/IsCurrentOption.ex.php b/api/v3/examples/Event/IsCurrentOption.ex.php index a0ce413047..8a40f7a6f2 100644 --- a/api/v3/examples/Event/IsCurrentOption.ex.php +++ b/api/v3/examples/Event/IsCurrentOption.ex.php @@ -53,7 +53,6 @@ function event_get_expectedresult() { 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues', 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues', 'event_type_id' => '1', - 'participant_listing_id' => 0, 'is_public' => '1', 'start_date' => '2013-07-29 00:00:00', 'event_start_date' => '2013-07-29 00:00:00', diff --git a/api/v3/examples/Event/IsFullOption.ex.php b/api/v3/examples/Event/IsFullOption.ex.php index 6954a283eb..07e6b42994 100644 --- a/api/v3/examples/Event/IsFullOption.ex.php +++ b/api/v3/examples/Event/IsFullOption.ex.php @@ -46,7 +46,6 @@ function event_getsingle_expectedresult() { 'event_title' => 'Annual CiviCRM meet', 'event_description' => '', 'event_type_id' => '1', - 'participant_listing_id' => 0, 'is_public' => '1', 'start_date' => '2008-10-21 00:00:00', 'event_start_date' => '2008-10-21 00:00:00', diff --git a/api/v3/examples/Participant/NestedEventGet.ex.php b/api/v3/examples/Participant/NestedEventGet.ex.php index 526905947a..58a12c7fb8 100644 --- a/api/v3/examples/Participant/NestedEventGet.ex.php +++ b/api/v3/examples/Participant/NestedEventGet.ex.php @@ -89,7 +89,6 @@ function participant_get_expectedresult() { 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues', 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues', 'event_type_id' => '1', - 'participant_listing_id' => 0, 'is_public' => '1', 'start_date' => '2013-07-29 00:00:00', 'event_start_date' => '2013-07-29 00:00:00', diff --git a/xml/schema/Event/Event.xml b/xml/schema/Event/Event.xml index b1cf8eeb47..d4c9c65299 100644 --- a/xml/schema/Event/Event.xml +++ b/xml/schema/Event/Event.xml @@ -86,7 +86,7 @@ int unsigned participant_listing_id Participant Listing - 0 + NULL participant_listing -- 2.25.1