symfony2admingenerator / FormExtensionsBundle

Symfony2 form extensions for Admingenerator project (also working standalone!)
Other
13 stars 14 forks source link

Could not load type "s2a_single_upload" (Symfony 3.2.*) #75

Closed rpostolov closed 7 years ago

rpostolov commented 7 years ago

Hi everyone, hope you're going well !

I am on symfony 3.2.* and i installed "symfony2admingenerator/form-extensions-bundle", "vich/uploader-bundle", "liip/imagine-bundle".

In my admingenerator-yml i have configured the field imageFile like this :

fields:           
      imageFile:
        label:            Image a  la une
        formType:         s2a_single_upload
        dbType:           string
        addFormOptions:
           deleteable: image  
           downloadable: true
           data_class: Symfony\Component\HttpFoundation\File\File 
           previewImages: true
           previewAsCanvas: true
           previewFilter: thumb_admin_list

But i have this issue : Could not load type "s2a_single_upload"

I search everywhere i could but i didn't found an answer, so if someone could help me that will be great !

Thanks a lot :)

tobias-93 commented 7 years ago

Hiya,

Instead of using the string s2a-single-upload for formType, you need the FQCN: Admingenerator\FormExtensionsBundle\Form\Type\SingleUploadType. This behavior changed in Symfony 2.8 and is the only available one to be used in the admingenerator.

Cheers!

calvera commented 7 years ago

use FQCN


formType: Admingenerator\FormExtensionsBundle\Form\Type\SingleUploadType
tobias-93 commented 7 years ago

See https://github.com/symfony2admingenerator/GeneratorBundle/blob/master/Resources/doc/admin/fields.md#form-type

rpostolov commented 7 years ago

Hi @tobias-93 & @calvera !

Thanks a lot to both of you for help !

Now it's working fine hehe :)