From ee34152a3490d2c3702108332b82e652c5c45bfa Mon Sep 17 00:00:00 2001 From: colemanw Date: Mon, 10 Feb 2025 22:59:13 -0500 Subject: [PATCH] ScheduledCommunications - Increase length of fields used by SearchKit for communications Fixes dev/core#5725 --- CRM/Upgrade/Incremental/php/SixOne.php | 30 +++++++++++++++++++++++ schema/Core/ActionSchedule.entityType.php | 4 +-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CRM/Upgrade/Incremental/php/SixOne.php b/CRM/Upgrade/Incremental/php/SixOne.php index 2ada821b94ac..20bb4322fb07 100644 --- a/CRM/Upgrade/Incremental/php/SixOne.php +++ b/CRM/Upgrade/Incremental/php/SixOne.php @@ -29,6 +29,36 @@ class CRM_Upgrade_Incremental_php_SixOne extends CRM_Upgrade_Incremental_Base { */ public function upgrade_6_1_alpha1($rev): void { $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev); + $this->addTask('Increase field length of civicrm_action_schedule.entity_status', 'alterSchemaField', 'ActionSchedule', 'entity_status', [ + 'title' => ts('Entity Status'), + 'sql_type' => 'varchar(255)', + 'input_type' => 'Select', + 'description' => ts('Entity status'), + 'add' => '3.4', + 'serialize' => CRM_Core_DAO::SERIALIZE_SEPARATOR_TRIMMED, + 'input_attrs' => [ + 'label' => ts('Entity Status'), + 'multiple' => '1', + 'control_field' => 'entity_value', + ], + 'pseudoconstant' => [ + 'callback' => ['CRM_Core_BAO_ActionSchedule', 'getEntityStatusOptions'], + ], + ]); + $this->addTask('Increase field length of civicrm_action_schedule.start_action_date', 'alterSchemaField', 'ActionSchedule', 'start_action_date', [ + 'title' => ts('Start Action Date'), + 'sql_type' => 'varchar(2048)', + 'input_type' => 'Select', + 'description' => ts('Entity date'), + 'add' => '3.4', + 'input_attrs' => [ + 'label' => ts('Start Date'), + 'control_field' => 'entity_value', + ], + 'pseudoconstant' => [ + 'callback' => ['CRM_Core_BAO_ActionSchedule', 'getActionDateOptions'], + ], + ]); } } diff --git a/schema/Core/ActionSchedule.entityType.php b/schema/Core/ActionSchedule.entityType.php index 0aef871e5474..4c78cd19741b 100644 --- a/schema/Core/ActionSchedule.entityType.php +++ b/schema/Core/ActionSchedule.entityType.php @@ -97,7 +97,7 @@ ], 'entity_status' => [ 'title' => ts('Entity Status'), - 'sql_type' => 'varchar(64)', + 'sql_type' => 'varchar(255)', 'input_type' => 'Select', 'description' => ts('Entity status'), 'add' => '3.4', @@ -152,7 +152,7 @@ ], 'start_action_date' => [ 'title' => ts('Start Action Date'), - 'sql_type' => 'varchar(64)', + 'sql_type' => 'varchar(2048)', 'input_type' => 'Select', 'description' => ts('Entity date'), 'add' => '3.4',