From 2f30b612840f48a53189bda8c443d210ca3daa83 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Thu, 21 Dec 2023 10:42:42 +0100 Subject: [PATCH] decode job payload data if it is a string --- src/Recorders/JobRecorder/JobRecorder.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Recorders/JobRecorder/JobRecorder.php b/src/Recorders/JobRecorder/JobRecorder.php index 5d7b9c25..6925d5ac 100644 --- a/src/Recorders/JobRecorder/JobRecorder.php +++ b/src/Recorders/JobRecorder/JobRecorder.php @@ -70,8 +70,15 @@ protected function getJobProperties(): array $properties = []; foreach ($payload as $key => $value) { - if (! in_array($key, ['job', 'data', 'displayName'])) { + if (!in_array($key, ['job', 'data', 'displayName'])) { $properties[$key] = $value; + + if (is_string($payload['data'])) { + try { + $properties['data'] = json_decode($payload['data'], true, 512, JSON_THROW_ON_ERROR); + } catch (Exception $exception) { + } + } } }