Skip to content

Commit 8156ec2

Browse files
authored
Check for model key before expecting it
Solves issues where the field may not have a `model` key, such as in `checklist_dependency` fields. This fixes the issue found in PermissionManager here - Laravel-Backpack/PermissionManager#291
1 parent c4eb4ae commit 8156ec2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/Library/CrudPanel/Traits/FakeFields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function compactFakeFields($requestInput, $model = false, $fields = [])
3939
$isFakeField = $field['fake'] ?? false;
4040

4141
// field is represented by the subfields
42-
if (isset($field['subfields']) && $field['model'] === get_class($model)) {
42+
if (isset($field['subfields']) && isset($field['model']) && $field['model'] === get_class($model)) {
4343
foreach ($field['subfields'] as $subfield) {
4444
$subfieldName = Str::afterLast($subfield['name'], '.');
4545
$isSubfieldFake = $subfield['fake'] ?? false;

0 commit comments

Comments
 (0)