symfony2admingenerator / AvocodeFormExtensionsBundle

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

Collection Upload : Option deletable not working #140

Open rpostolov opened 10 years ago

rpostolov commented 10 years ago

Hi,

i have some issue with collection upload. I'm using Avocde, vich uploader both with admingenerator.

It's show me the form, and the upload works fine (after remove some option like nameable and editable because of some issues, see : #139 ) , but after uploading and saving i try to check the input for deleting the file and it doesn't work.

In fact the checkbox have class 'disabled' and i don't know why because i set the option deletable at true, see here all the configuration :

images:
        label:            Images
        dbType:           collection
        formType:         afe_collection_upload
        addFormOptions:
            primary_key:          id
            nameable:             false
            sortable:             true
            sortable_field:       position
            editable:             [ legende ]
            type:                 \Tranoi\DesignerInscritBundle\Form\Type\ImageAdmin\EditType
            maxNumberOfFiles:     5
            maxFileSize:          500000
            minFileSize:          1000
            acceptFileTypes:      /(\.|\/)(gif|jpe?g|png)$/i
            loadImageFileTypes:   /^image\/(gif|jpe?g|png)$/i
            loadImageMaxFileSize: 250000
            previewMaxWidth:      100
            previewMaxHeight:     100
            previewAsCanvas:      true
            previewFilter:        thumb_gallery_images
            prependFiles:         false
            allow_add:            true
            allow_delete:         true
            error_bubbling:       true
            options:
                data_class:       Tranoi\DesignerInscritBundle\Entity\Image

When i took a look to the documentation i dont have the explanation for this some options, mays not updated ?

If you have some idea ?

Thanks guys !

rpostolov commented 10 years ago

Other thing, when i want to save some modification to the object i have some bubble message which tells me that i have to complete the field 'Legende' even if it's completed (see my option editable : [ legende ]) .

rpostolov commented 10 years ago

Okay, i figure it out !

I think it's a bug cause in these files the class 'disable' is wrote directly in the code.:

...\vendor\avocode\form-extensions-bundle\Avocode\FormExtensionsBundle\Resources\views\Form\BootstrapCollection\collection_delete.html.twig

 => <label class="btn btn-toggle disabled input-append">
    <input type="checkbox" name="toggle">
</label>

...\vendor\avocode\form-extensions-bundle\Avocode\FormExtensionsBundle\Resources\views\Form\form_widgets.html.twig

=> <label class="btn btn-toggle disabled input-append">
                <input type="checkbox" class="toggle">
            </label>

...\vendor\avocode\form-extensions-bundle\Avocode\FormExtensionsBundle\Resources\views\Form\BootstrapCollection\collection_batch_delete.html.twig

=> <label class="btn btn-toggle disabled input-append">
        <input type="checkbox" name="delete" value="1">
    </label>
...\vendor\avocode\form-extensions-bundle\Avocode\FormExtensionsBundle\Resources\views\Form\CollectionUpload\template_download.html.twig

=> <span class="btn btn-toggle disabled input-append">
                        <input class="toggle" type="checkbox" name="delete" value="1">
                    </span>

Maybe a bug in Avocode ?

rpostolov commented 10 years ago

And no idea for the second issue with the option editable ?