Skip to content

Commit f29327b

Browse files
committed
arrayed parent names can't be used
1 parent ae6e01c commit f29327b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ protected function makeSureSubfieldsHaveNecessaryAttributes($field)
268268
$subfield = ['name' => $subfield];
269269
}
270270

271-
$subfield['parentFieldName'] = $field['name'];
271+
$subfield['parentFieldName'] = is_array($field['name']) ? false : $field['name'];
272272

273273
if (! isset($field['model'])) {
274274
// we're inside a simple 'repeatable' with no model/relationship, so

src/resources/views/crud/fields/inc/wrapper_start.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// if the field is required in any of the crud validators (FormRequest, controller validation or field validation)
1010
// we add an astherisc for it. Case it's a subfield, that check is done upstream in repeatable_row.
1111
// the reason for that is that here the field name is already the repeatable name: parent[row][fieldName]
12-
if(!isset($field['parentFieldName'])) {
12+
if(!isset($field['parentFieldName']) || !$field['parentFieldName']) {
1313
$fieldName = is_array($field['name']) ? current($field['name']) : $field['name'];
1414
$required = (isset($action) && $crud->isRequired($fieldName)) ? ' required' : '';
1515
}

0 commit comments

Comments
 (0)