Commit 67ec9a8d authored by jaapjansma's avatar jaapjansma
Browse files

Changed Event Participants Field Output Handler to return a string.

parent 1287424f
......@@ -8,6 +8,7 @@
# Version 1.0.7
* Changed Event Participants Field Output Handler to return a string.
* Build a cache clear when a data processor configuration is changed.
# Version 1.0.6
......
......@@ -104,7 +104,7 @@ class EventParticipantsFieldOutputHandler extends AbstractFieldOutputHandler imp
*/
public function formatField($rawRecord, $formattedRecord) {
$event_id = $rawRecord[$this->inputFieldSpec->alias];
$output = new JsonFieldOutput();
$output = new FieldOutput();
if ($event_id) {
$participantsSql = "
SELECT `c`.`display_name`, `c`.`id` as `contact_id`, `p`.`id` as `participant_id`
......@@ -123,16 +123,10 @@ class EventParticipantsFieldOutputHandler extends AbstractFieldOutputHandler imp
$jsonData = array();
$dao = \CRM_Core_DAO::executeQuery($participantsSql, $participantsSqlParams);
while($dao->fetch()) {
$participants[] = $dao->display_name;
$jsonData[] = array(
'contact_id' => $dao->contact_id,
'participant_id' => $dao->participant_id,
'display_name' => $dao->display_name
);
$participants[$dao->contact_id] = $dao->display_name;
}
$output->rawValue = implode(', ', $participants);
$output->formattedValue = implode(', ', $participants);
$output->setData($jsonData);
}
return $output;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment