sonata-project / SonataMediaBundle

Symfony SonataMediaBundle
https://docs.sonata-project.org/projects/SonataMediaBundle
MIT License
449 stars 496 forks source link

Local driver directory wrong set by default beginning from Symfony 4 #2341

Closed dmitryuk closed 1 year ago

dmitryuk commented 1 year ago

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?

VincentLanglet commented 1 year ago

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 ?