1up-lab / OneupUploaderBundle

This Symfony bundle provides a server implementation for handling single and multiple file uploads using either FineUploader, jQuery File Uploader, YUI3 Uploader, Uploadify, FancyUpload, MooUpload, Plupload or Dropzone. Features include chunked uploads, orphanages, Gaufrette and Flysystem support.
MIT License
604 stars 177 forks source link

Missing compatibility with Flysystem v2 #404

Closed Rikijs closed 2 years ago

Rikijs commented 3 years ago

Question

boundle version
symfony 5.2.6
oneup/flysystem-bundle 4.0.6
oneup/uploader-bundle 3.1.2

Made an upgrade to Oneup Flysystem and Oneup Uploader in order to use latest Flysystem v2! Yet i am getting an error while uploading files.

Argument 1 passed to Oneup\UploaderBundle\Uploader\Storage\FlysystemStorage::__construct() must be an instance of League\Flysystem\FilesystemInterface, instance of League\Flysystem\Filesystem given, called in D:\DEV\Izstrade_WEB_DEV\_DEV_SF5_\zenfiles5\var\cache\dev\Container9LbNvYG\getOneupUploader_Controller_GalleryService.php on line 28

relevant part of services.yaml

    oneup_flysystem.gallery_filesystem:
        alias: League\Flysystem\Filesystem
        public: true

    League\Flysystem\Local\LocalFilesystemAdapter: '@oneup_flysystem.adapter.local'
    League\Flysystem\MountManager: '@oneup_flysystem.mount_manager'

my oneup_uploader.yaml

oneup_uploader:
    mappings:
        gallery:
            storage:
                type: flysystem
                filesystem: oneup_flysystem.gallery_filesystem

            frontend: blueimp
            enable_progress: true
            namer: app.upload_unique_namer

            max_size: !php/const App\Entity\AppConstants::UPLOADABLE_FILE_SIZE_MAX

my oneup_flysystem.yaml

oneup_flysystem:
    adapters:
        my_adapter:
            local:
                location: '%data_dir_stored%'

    filesystems:
        default_filesystem:
            adapter: my_adapter
            alias: League\Flysystem\Filesystem

I tried changing League\Flysystem\Filesystem referrences in YAML to League\Flysystem\FilesystemInterface. It has no effect - the same error persists.

It might be misconfiguration issue or a bug.

Any help would be appreciated, thank you!

bytehead commented 3 years ago

I'm afraid the bundle is not yet compatible with flysystem v2 😢

League\Flysystem\FilesystemInterface does not exist anymore in flysystem v2.

bytehead commented 3 years ago

I'm curious why you could even combine this bundle with oneup/flysystem-bundle v4? 🤔

https://github.com/1up-lab/OneupUploaderBundle/blob/3d711a21d4a983443797b83bd763557067e72b85/composer.json#L52

Rikijs commented 3 years ago

I bumped versions of 2 oneup bundles manually and run composer update asuming support of FlySystem v2 is complete.

Project was working good with FlySystem v1 (oneup/flysystem-bundle v3.7.0 and oneup/uploader-bundle v3.1.2). Looks like will have to downgrade now to v1 again.

bytehead commented 3 years ago

I see. I have to make it compatible with the new flysystem-bundle release first.

bytehead commented 3 years ago

Project was working good with FlySystem v1 (oneup/flysystem-bundle v3.7.0 and oneup/uploader-bundle v3.1.2). Looks like will have to downgrade now to v1 again.

I'll keep you updated with the progress 👍

Rikijs commented 3 years ago

Thanks, much appreciated!

aless673 commented 3 years ago

Hey, is there any news ? This is an important feature, we also updated to Flysystem v2 and discovered that Oneup was finally not compatible

bytehead commented 3 years ago

Not yet as I didn't have any free time left to work on our OSS projects :(

markitosgv commented 3 years ago

same issue here too

seizan8 commented 2 years ago

I'm curious why you could even combine this bundle with oneup/flysystem-bundle v4? 🤔

https://github.com/1up-lab/OneupUploaderBundle/blob/3d711a21d4a983443797b83bd763557067e72b85/composer.json#L52

It's in "require-dev". I assume if you don't add the dependency for "dev" than it gets ignored. The composer.json should be extended with

"conflict": {
    "oneup/flysystem-bundle": "^4.0"
},

That should prevent this problem.

Rikijs commented 2 years ago

Upgraded project to Symfony v6.0.8. It works with OneUp bundles latest releases

boundle version
oneup/flysystem-bundle 4.4.1
oneup/uploader-bundle 3.2.0
Rikijs commented 2 years ago

Closing as issue is solved