silasjoisten / sonata-multiupload-bundle

MIT License
30 stars 16 forks source link

Add more flexibility by not decorating default controller #155

Closed mpoiriert closed 2 years ago

mpoiriert commented 2 years ago

This will allow to override the create method even if we are using another controller for the admin.

Also the decorates is not implemented properly since you must call all the methods of the original decorated controller (the MediaAdminController does override the listAction).

It's better to not decorate in this case.

mpoiriert commented 2 years ago

We could also consider renaming the controller MediaAdminController for CreateController to follow naming convetion of "MultiUploadController"

silasjoisten commented 2 years ago

@mpoiriert have you tested it?

mpoiriert commented 2 years ago

@silasjoisten I have rename the controller.

I did also change the MultiUploadController to rely on "$this->admin" instead of injecting the MediaAdmin. This remove code and allow to have a custom Media Admin instead of forcing use to use the provided MediaAdmin.

I have use my branch directly in my project so I do confirm it's working.

silasjoisten commented 2 years ago

Nice great Job! Thanks a lot only this small change i suggested then i merge it and release it

silasjoisten commented 2 years ago

@mpoiriert Thank you!

silasjoisten commented 2 years ago

released in 4.0.1