Giter VIP home page Giter VIP logo

sonata-multiupload-bundle's People

Contributors

dependabot[bot] avatar filoz avatar greg0ire avatar malikzh avatar mpoiriert avatar oskarstark avatar tifabien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sonata-multiupload-bundle's Issues

Update with recent sonata version, drop requirement of "sonata-project/core-bundle"

I want to use this bundle but the newest version of sonata-project is incompatible with the core-bundle.

Do you plan to update this bundle or if you don't and we do it can we make a PR ? It will need a major release.

And before we do this can you confirm that it's a good solution for multi-upload in sonata or you think something else could be better ?

More detailed documentation

Hi silas,
Can you please explain how to overwrite an existent provider (like image) instead of create a new one (Step 3)?

I'm new to Symfony and want to work with the Sonata Image provider. A more detailed documentation will be useful for me and so many others.

Thank you!

Can't get it to work SF4

Hello,
I am trying to get this to work but am a little bit stuck.

// App\Application\Sonata\MediaBundle\Provider\MultiImageProvider.php
<?php

namespace App\Application\Sonata\MediaBundle\Provider;

use SilasJoisten\Sonata\MultiUploadBundle\Traits\MultiUploadTrait;

class MultiImageProvider extends \Sonata\MediaBundle\Provider\FileProvider
{
    use MultiUploadTrait;
}
// config/services.xml
  <service id="sonata.media.provider.multi_image" class="App\Application\Sonata\MediaBundle\Provider\MultiImageProvider" public="true">
            <tag name="sonata.media.provider" multi_upload="true"/>
            <argument>sonata.media.provider.multi_image</argument>
            <argument type="service" id="sonata.media.filesystem.local"/>
            <argument type="service" id="sonata.media.cdn.server"/>
            <argument type="service" id="sonata.media.generator.default"/>
            <argument type="service" id="sonata.media.thumbnail.format"/>
        </service>
// config/packages/sonata_media.yaml
sonata_media:
    default_context: default
    db_driver: doctrine_orm
    contexts:
        default:
            download:
                strategy: App\Security\Media\DownloadStrategy
                mode: http
            providers:
                - sonata.media.provider.dailymotion
                - sonata.media.provider.youtube
                - sonata.media.provider.image
                - sonata.media.provider.file
                - sonata.media.provider.vimeo
                - sonata.media.provider.multi_image
//Admin Class
$form->add('media', MediaType::class, [
            'provider' => 'sonata.media.provider.multi_image',
            'context' => 'default',
            'data_class' => 'App\Application\Sonata\MediaBundle\Entity\Media',
            'required' => true,
        ]);

The upload is still the same and I feel like I am doing something really basic wrong or missing something. How do I get my form to display the multiupload instead of normal upload?

ManagerInterface

@sonata.media.manager.media with doctrine_orm have default instance Sonata\MediaBundle\Entity\MediaManager which implement Sonata\Doctrine\Model\ManagerInterface

Replace statement from
src/Controller/MultiUploadController.php:6

use Sonata\CoreBundle\Model\ManagerInterface;
to
use Sonata\Doctrine\Model\ManagerInterface;

Add from model type not working anymore

If we have a link to a image and use the "Add New" button it will not work anymore.

Maybe adding a check if it's a ajax call for the select provider and ignore the multi upload in that case ?

Does not work on Symfony 4

Hello. I can not connect the bandl in the four.

->add( 'audio', ModelListType::class, array(
    'label'    => $this->trans( 'object.audio' ),
    'required' => false
), array( 'link_parameters' => array('context' => 'phrases_audio')))

I did everything according to the documentation, but after uploading the files they are not attached to the entity, checking the directory in which the file should appear - also not.

Could not upload file in Gallery (Sonata Media Bundle)

Hi,

I'm not able to upload images via multiupload form when I'm adding images to gallery
vyber_523

If I click on Add new in Gallery item row, I got Upload complete but in console, there is this error and image is not uploaded.
vyber_525

When I upload file via Media page, everything is fine.

Symfony Flex

Hi,
is Symfony Flex really required?

In Sonata Media it is not a requirement

thank you!

Argument 1 passed to Sonata\AdminBundle\Controller\CRUDController::get() must be of the type string, null given, called in /var/www/html/Project/vendor/silasjoisten/sonata-multiupload-bundle/src/Controller/MultiUploadController.php on line 55

Environment

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.52.0 3.53.0 The missing Symfony Admin Generator
sonata-project/block-bundle              3.17.0 3.17.0 Symfony SonataBlockBundle
sonata-project/cache                     1.1.1  2.0.1  Cache library
sonata-project/cache-bundle              2.4.2  3.1.0  This bundle provides caching services
sonata-project/core-bundle               3.17.0 3.17.0 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.5.0  3.0.0  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.3.0  1.3.0  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.10.0 3.10.0 Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle       2.5.0  2.5.0  Symfony SonataEasyExtendsBundle
sonata-project/exporter                  2.0.1  2.0.1  Lightweight Exporter library
sonata-project/formatter-bundle          4.1.3  4.1.3  Symfony SonataFormatterBundle
sonata-project/media-bundle              3.20.1 3.20.1 Symfony SonataMediaBundle
sonata-project/notification-bundle       3.6.2  3.6.2  Symfony SonataNotificationBundle
sonata-project/page-bundle               3.11.1 3.12.0 This bundle provides a Site and Page management through container and block services
sonata-project/seo-bundle                2.7.0  2.7.0  Symfony SonataSeoBundle

PHP version

$ php -v
PHP 7.2.21-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Aug  7 2019 09:53:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.21-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

Subject

I've installed and added this route(admin_sonata_media_media_multi_upload) to my admin menu. I got the below error while clicking the menu link (http://www.example.com/admin/sonata/media/media/multi-upload)

Argument 1 passed to Sonata\AdminBundle\Controller\CRUDController::get() must be of the type string, null given, called in /var/www/html/Project/vendor/silasjoisten/sonata-multiupload-bundle/src/Controller/MultiUploadController.php on line 55

Steps to reproduce

Follow the 3 steps upto adding parameter in config/services.yaml which is explained in this bundle doc

Expected results

Multiple file upload

Actual results

Argument 1 passed to Sonata\AdminBundle\Controller\CRUDController::get() must be of the type string, null given, called in /var/www/html/Project/vendor/silasjoisten/sonata-multiupload-bundle/src/Controller/MultiUploadController.php on line 55

Seems file extensions are not validated during multiupload

Hi,

I'm using the bundle and my user raised an issue related to file extensions. It seems that the allowedExtensions and the allowedMimeTypes properties are not took into account when the MultiUploadController::multiUploadAction method is used.

How can we do to validate the media when this controller action is called and how can we handle the form violation messages in the view?

  • Add file extension validation by javascript
  • Add MimeType validation by javascript
  • Handle Messages by javascript
  • Update Documentation
  • Create UPGRADE note
  • Use Symfony Form validation on POST

Thanks for your help!

Return to the media list onComplete

Hello,

A nice feature for this bundle would be an option so that the user is automatically redirected to the media list when all uploads are complete.
This could be done using the onComplete callback in dmFileUploader, in multi_upload.hml.twig.

What do you think? Should I open a pull request?

Can't get this bundle to work

Hi there, I followed the docs and I can't seem to get this bundle to work.

I'm trying to add the multi upload to my custom svg provider but it's not working. It still shows me the default file upload of sonata.

What could I be doing wrong?

Cannot autowire service

Cannot autowire service "App\Controller\MediaAdminController": argument "$mediaManager" of method "SilasJoisten\Sonata\MultiUploadBundle\Controller\MultiUploadController::__construct()" references interface "Sonata\Doctrine\Model\ManagerInterface" but no such service exists. You should maybe alias this interface to one of these existing services: "sonata.media.manager.media", "sonata.media.manager.gallery".

Is there any way to define the min/max width-height and orientation requirements?

Great extension! Thanks!
Any question.

  1. Is there any way to define the min/max width-height and orientation requirements for images? Is it possible to add a validate call to the my provider ?

`<?php

namespace Application\Sonata\MediaBundle\Provider;

final class PosterProvider extends ImageProvider
{
use MultiUploadTrait;

public function getProviderMetadata()
{
    return new Metadata($this->getName(),
        $this->getName().'.description',
        false,
        'SonataMediaBundle',
        ['class' => 'fa fa-picture-o']
    );
}

`

  1. When adding a new media, how can I immediately go to upload without selecting a provider?

Reducing the multiupload.gif file

Hi,

I would like to know whether it was possible to reduce the size of the multiupload.gif file or maybe move this file on a CDN as the bundle is taking ~8MB because of the size of this file?

Btw thanks a lot for your bundle it improves the usage of the upload process a lot!

Rework docs

  • Update docs for 6.x
  • Update UPGRADE.md (extends from SonataMedia Controller not possible anymore)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.