silasjoisten / sonata-multiupload-bundle Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
When uploading a video no preview image is shown.
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 ?
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!
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?
@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;
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 ?
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.
Currently there is a hardcoded value. It should be configurable.
max_upload_file_size
default 0It would be nice if somebody could test that new release. It contains breaking changes. See https://github.com/silasjoisten/sonata-multiupload-bundle/blob/adab5d0b86ccf7a6f5960ab1da9eff6dc627acbd/UPGRADE.md for upgrade instructions.
Hi,
is Symfony Flex really required?
In Sonata Media it is not a requirement
thank you!
$ 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 -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
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
Follow the 3 steps upto adding parameter in config/services.yaml which is explained in this bundle doc
Multiple file 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
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?
Thanks for your help!
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?
Would be great if someone could add translation in russian.
Drop php 7.0 support
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?
Hey silas,
https://github.com/silasjoisten/sonata-multiupload-bundle/blob/master/LICENCE
has a typo. It should be LICENSE, shouldn‘t it?
Needed is a removeProvider
function to remove a Provider on runtime
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".
The translation files needs to get renamed from .yml
to .yaml
. Symfony Best Practice tells
Would be great if someone could add translation in french.
I want to get a rid of the jQuery dependency and use VueJs in combination with headlessUI and tailwindCSS
Benefits:
script
tags in templates and seperate it into Javascript files@contributors What you guys think?
Great extension! Thanks!
Any question.
`<?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']
);
}
`
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.