Closed Martin1982 closed 3 years ago
HI @Martin1982, do you have a repository to reproduce the error ? It would allow us to debug this more easily
I just committed a temporary fix (which is downgrading to 3.76) to my demo project so you'd have to upgrade admin-bundle to 3.77 to let the error re-occur again;
https://github.com/Martin1982/live-broadcast-demo
If you'd like to test using my project, create a twitch channel and then plan a new broadcast with no channel or input attached.
The same issue occured yesterday in our main Spinnin' Records admin on a whole different entity, but that one is a private repo.
@phansys It's related to this PR: https://github.com/sonata-project/SonataAdminBundle/pull/6315/files
The issue is that addIdentifiersToQuery is not working when called with an empty array https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/3.x/src/Model/ModelManager.php#L504-L525
Imho we should
Having the same problem!
Environment
Local Symfony server php 7.3 on MacOS PHP7.4 FPM on Ubuntu Docker
Sonata packages
Symfony packages
PHP version
Subject
When creating an admin class with an optional ModelType field the entity cannot be saved when leaving the field empty. I tried it on multiple fields with multiple configurations. It doesn't seem to me a query error would be the expected result.
Steps to reproduce
Create an admin field with a ModelType:
Expected results
The item gets saved with no item attached
Actual results
500-error;