From ad6ea1b1e1993f316a528fbc891ef71ca718d97e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 8 Sep 2021 21:13:05 -0700 Subject: [PATCH] (REF) WorkflowMessageExample - Set data_type=Array. Remove serialization bits. --- Civi/Api4/Action/WorkflowMessageExample/Get.php | 8 ++------ Civi/Api4/WorkflowMessageExample.php | 7 +++++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Civi/Api4/Action/WorkflowMessageExample/Get.php b/Civi/Api4/Action/WorkflowMessageExample/Get.php index c084fc7069..64cbc1f570 100644 --- a/Civi/Api4/Action/WorkflowMessageExample/Get.php +++ b/Civi/Api4/Action/WorkflowMessageExample/Get.php @@ -33,6 +33,7 @@ class Get extends BasicGetAction { private $_scanner; public function _run(Result $result) { + $this->_scanner = new Examples(); if ($this->select !== [] && !in_array('name', $this->select)) { $this->select[] = 'name'; } @@ -40,12 +41,7 @@ class Get extends BasicGetAction { } protected function getRecords() { - $this->_scanner = new Examples(); - $all = $this->_scanner->findAll(); - foreach ($all as &$example) { - $example['tags'] = !empty($example['tags']) ? \CRM_Utils_Array::implodePadded($example['tags']) : ''; - } - return $all; + return $this->_scanner->findAll(); } protected function selectArray($values) { diff --git a/Civi/Api4/WorkflowMessageExample.php b/Civi/Api4/WorkflowMessageExample.php index 6b05bc44e1..c672e6d91c 100644 --- a/Civi/Api4/WorkflowMessageExample.php +++ b/Civi/Api4/WorkflowMessageExample.php @@ -60,8 +60,11 @@ class WorkflowMessageExample extends \Civi\Api4\Generic\AbstractEntity { [ 'name' => 'tags', 'title' => 'Tags', - 'data_type' => 'String', - 'serialize' => \CRM_Core_DAO::SERIALIZE_SEPARATOR_BOOKEND, + 'data_type' => 'Array', + 'options' => [ + 'preview' => ts('Preview: Display as an example in the "Preview" dialog'), + 'phpunit' => ts('PHPUnit: Run basic sniff tests in PHPUnit using this example'), + ], ], [ 'name' => 'data', -- 2.25.1