From fca3de8e8d09df7549c8601b49a6dab2dcc9ec4d 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..98fcd10d2ede 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(255)', + '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..4bad140963ee 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(255)', 'input_type' => 'Select', 'description' => ts('Entity date'), 'add' => '3.4',