Skip to content

Commit

Permalink
Ensure fields are an array
Browse files Browse the repository at this point in the history
  • Loading branch information
martyf committed Oct 16, 2023
1 parent e3e4ed9 commit 40017e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Forms/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public function create()
$data['sections'] = $this->getSections($this->sessionHandle(), $jsDriver);
if (!empty($data['sections'])) {
// fields have already been rendered in the sections: get from the sections to avoid a re-render
$data['fields'] = collect($data['sections'])->map(fn($section) => $section['fields'])->flatten(1);
$data['fields'] = collect($data['sections'])->map(fn($section) => $section['fields'])
->flatten(1)
->values()
->all();
} else {
// render fields directly
$data['fields'] = $this->getFields($this->sessionHandle(), $jsDriver);
Expand Down

0 comments on commit 40017e6

Please sign in to comment.