Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with NewEvent Key #196

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Models/FormEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
}
Loading