From 291a2de37e19014e9580fb1a5dfc338908836742 Mon Sep 17 00:00:00 2001 From: kaioken Date: Sun, 21 Jul 2024 07:22:04 -0400 Subject: [PATCH] refact: when they seng strigify message --- .../Internal/Activities/GenerateMessageSlugActivity.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Domains/Connectors/Internal/Activities/GenerateMessageSlugActivity.php b/src/Domains/Connectors/Internal/Activities/GenerateMessageSlugActivity.php index b2d0f1c2b..238b4f92f 100644 --- a/src/Domains/Connectors/Internal/Activities/GenerateMessageSlugActivity.php +++ b/src/Domains/Connectors/Internal/Activities/GenerateMessageSlugActivity.php @@ -26,7 +26,8 @@ public function execute(Model $message, AppInterface $app, array $params): array return ['No field configured to generate slug']; } - $fieldToSlug = $message->message[$slugField] ?? null; + $messageData = is_array($message->message) ? $message->message : (Str::isJson($message->message) ? json_decode($message->message, true) : []); + $fieldToSlug = $messageData[$slugField] ?? null; if ($fieldToSlug === null) { return ['No slug field {' . $slugField . ' found in message ' . $message->id];