Closed ndoulgeridis closed 9 years ago
It seems fixed by adding mapped=>false
->add('id', 'hidden', array("mapped"=>false))
@crash21 yes, this fix is very good for this
The id
property is rendered (and used) by the UploadCollectionListener to handle "deleting".
If an item with id X
is in the collection... but id X
is not present in POST, then the eventlistener understands that item X has been removed (via JS) on client side and should be also removed on server side.
So, the id is never meant to be mapped (or changed), it's just used as a unique identifier for the "delete" functionality implementation.
Nice!
Something else suspicious is that in template this is hardcoded:
<label class="btn btn-toggle disabled input-append">
<input type="checkbox" class="toggle">
</label>
So the checkbox to select all files is every time disabled (both the master and the children checkboxes has disabled class..)
Any ideas about this?
Hey,
I am trying collection_upload. Parent form has this:
Child Form has this:
Everything works fine except on edit if i keep the images already uploaded there and sumit form I get this error:
NoSuchPropertyException in PropertyAccessor.php line 456: Neither the property "id" nor one of the methods "addId()"/"removeId()", "setId()", "id()", "set()" or "call()" exist and have public access in class "...".
Its logical because child form has id field which in entity is the PK and there is no setId and name doenst not exist in Entity.
Any idea what I am doing wrong?
EDIT:
In this example here:
https://github.com/symfony2admingenerator/AvocodeFormExtensionsBundle/issues/32
You set id as integer, if I do so I don't get error but in edit mode I get a filed to set id... But If i set id hidden I get mapping error :(