Skip to content

Commit

Permalink
Merge pull request #196 from PortableStudios/fix/Form_NewEvent_Key
Browse files Browse the repository at this point in the history
Fix issue with NewEvent Key
  • Loading branch information
jeremy-portable authored Nov 15, 2024
2 parents 86b4408 + b1fae60 commit a4ddf40
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Models/FormEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ public function user()

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);
});
}
}

0 comments on commit a4ddf40

Please sign in to comment.