symfony2admingenerator / AvocodeFormExtensionsBundle

(old-legacy) Symfony2 form extensions for Admingenerator project (also working standalone!)
Other
48 stars 31 forks source link

Bugfix if own subtype of afe_single_upload #122

Closed pakaufmann closed 10 years ago

pakaufmann commented 10 years ago

Fixes a bug when creating an own form type which has afe_single_upload as a parent.

When creating a form type with afe_single_upload as parent the file on the entity is not set correctly. Instead it is set to array([file] => [UploadedFile]). This happens because the SingleUploadSubscriber only checks the actual form field onto it's type, but not the parents. So if you extend the afe_single_upload its behavior changes because of that.

The fix just recurses over all parents and checks if the form extends from afe_single_upload.

ioleo commented 10 years ago

@kufi very nice, thanks!