Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection Upload : Option deletable not working #140

Open
rpostolov opened this issue Aug 5, 2014 · 3 comments
Open

Collection Upload : Option deletable not working #140

rpostolov opened this issue Aug 5, 2014 · 3 comments

Comments

@rpostolov
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant