From 5fcfe43f3cad93ef4e6cbcbae301fe0933201bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Wolda=C5=84ski?= Date: Wed, 10 May 2023 12:29:58 +0200 Subject: [PATCH] [FEATURE] Allow non cachable plugins to return null on empty Handles cases when plugin marked as USER_INT wants to in some case do not return some data, by default instead of empty string, we want set null for better type system in FE app --- Classes/ContentObject/JsonContentObject.php | 2 +- Classes/Utility/HeadlessUserInt.php | 82 +++++++++++++-------- Tests/Unit/Hooks/HeadlessUserIntTest.php | 52 +++++++++++++ 3 files changed, 106 insertions(+), 30 deletions(-) diff --git a/Classes/ContentObject/JsonContentObject.php b/Classes/ContentObject/JsonContentObject.php index 1555ad1b..14f29664 100755 --- a/Classes/ContentObject/JsonContentObject.php +++ b/Classes/ContentObject/JsonContentObject.php @@ -114,7 +114,7 @@ public function cObjGet(array $setup, string $addKey = ''): array $content[$theKey] = (bool)$content[$theKey]; } if ($theValue === 'USER_INT' || strpos((string)$content[$theKey], '