From 72d5f02220d96f90bf0ba1964a6dc451f029fcb3 Mon Sep 17 00:00:00 2001 From: jeremy-portable Date: Wed, 13 Nov 2024 08:16:56 +0800 Subject: [PATCH 1/2] Fix issue with NewEvent Key --- src/Models/FormEntry.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Models/FormEntry.php b/src/Models/FormEntry.php index 1bffd0c9..84c71327 100644 --- a/src/Models/FormEntry.php +++ b/src/Models/FormEntry.php @@ -40,8 +40,14 @@ public function form() public function displayHtml(): Attribute { + /** + * Some of the implementation uses "newEvent" (training, for example) + * While others somehow breaks as they do not use this key + * Instead of finding all the areas and align them on one format to another + * I believe it's better to just accommodate both use cases for backward and forward compatibility + */ return new Attribute(function () { - return FormBuilder::getDisplayFields($this->fields, $this->values['newEvent']); + return FormBuilder::getDisplayFields($this->fields, $this->values['newEvent'] ?? $this->values); }); } } From b1fae60b85bb0c33ab7496d6b31f7812a73b946f Mon Sep 17 00:00:00 2001 From: jeremy-portable Date: Wed, 13 Nov 2024 08:38:05 +0800 Subject: [PATCH 2/2] Fix issue with NewEvent Key --- src/Models/FormEntry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/FormEntry.php b/src/Models/FormEntry.php index 84c71327..9382a030 100644 --- a/src/Models/FormEntry.php +++ b/src/Models/FormEntry.php @@ -40,7 +40,7 @@ public function form() public function displayHtml(): Attribute { - /** + /** * Some of the implementation uses "newEvent" (training, for example) * While others somehow breaks as they do not use this key * Instead of finding all the areas and align them on one format to another