sonata-project / SonataMediaBundle

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

MediaBlockService required if formats defined #2435

Open mesiarm opened 9 months ago

mesiarm commented 9 months ago

Make format key always optional even if formats are defined. Now it is: 'required' => \count($formatChoices) > 0, It is unable to set some of images reference if formats are defined

VincentLanglet commented 5 months ago

HI @mesiarm, can you explain why the format key should be optional ?

mesiarm commented 5 months ago

HI @mesiarm, can you explain why the format key should be optional ?

There may be cases, when I want to choose it by programming logic or use full size.

VincentLanglet commented 5 months ago

There may be cases, when I want to choose it by programming logic or use full size.

But I assume the data need to be required for people which doesn't have extra-programming-logic. Changing the field to optional will create an issue for them.

Does adding an option to configureSettings would help you ?

mesiarm commented 5 months ago

There may be cases, when I want to choose it by programming logic or use full size.

But I assume the data need to be required for people which doesn't have extra-programming-logic. Changing the field to optional will create an issue for them.

Does adding an option to configureSettings would help you ?

Yes, it would help

VincentLanglet commented 5 months ago

PR welcomed then.