sonata-project / SonataMediaBundle

Symfony SonataMediaBundle

Home Page:https://docs.sonata-project.org/projects/SonataMediaBundle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Local driver directory wrong set by default beginning from Symfony 4

dmitryuk opened this issue · comments

Subject

Sonata media Configuration has with default value
https://github.com/sonata-project/SonataMediaBundle/blob/4.x/src/DependencyInjection/Configuration.php#L195

->scalarNode('directory')->defaultValue('%kernel.project_dir%/web/uploads/media')->end()

But starting from Symfony 4.4 web folder moved to public. So the bundle not working as expected

Possible solution

Use first exiting folder: web or public

What do you think?

It's a nice idea ; we should have got this one in the previous major version...
We could add a comment, because changing now is technically a BC break...
WDYT @jordisala1991 ?