Easyadminbundle: [Help Wanted] Fix some bugs of the new ArrayField

Created on 2 May 2020  路  2Comments  路  Source: EasyCorp/EasyAdminBundle

Describe the bug
In e2331de we added a new ArrayField. It "works", but it has some issues that I cannot solve. I need the help from someone who understands the Symfony Forms well. Thanks!

Issue 1

In Edit page, the "remove" button works, but the "add new item" button doesn't work:

image

I can't see any JavaScript error in the browser console.

Issue 2

The new page doesn't work because of this error:

image

I can't understand why prototype doesn't exist in new (but it exists in edit). If I change that line by:

'data-form-type-name-placeholder': prototype is defined ? prototype.vars.name : '',

The error is gone ... but nothing is displayed for this field, so you cannot add anything.

bug help wanted

All 2 comments

Hi there! I tried a little bit and for issue 1, looks like as ArrayField uses CollectionType so 'bundles/easyadmin/form-type-collection.js' should be included in ArrayField.

I couldn't reproduce the issue 2 馃槙

Thanks a lot for looking into these issues. I finally could fix the second issue in 7603a551179e7cf07056cf3fac71e6ec982b19a6. The bug was that we were returning too early when the value is null. If you don't set allow-add, then the prototype var is not created.

Was this page helpful?
0 / 5 - 0 ratings