-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not use null as default value #1265
Do not use null as default value #1265
Conversation
Looks like the problem is that SonataDoctrineORMAdminBundle/src/Guesser/FilterTypeGuesser.php Lines 90 to 98 in 4098faf
I guess the Either way, IMO a test should be added. |
It should instead rely on the default value like here: https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/3.x/src/Filter/DateFilter.php#L39 There is no reason to set |
So, should we remove the rest of |
That's a good point. Other filters are setting the field_type because they were no default one. For instance, the NumberFilter is not overriding the getFieldType method
I'll fix this. |
By the way, in SonataAdmin we're not using |
56eee88
to
a4cba49
Compare
Rely on default value instead
a4cba49
to
6460d4f
Compare
@franmomu Tests are updated to check that |
* Do not pass field_type to Filter (#1265) Rely on default value instead * Add composite primary keys tests * Fix pager for composite id * Add tests * Remove trademarks * Bump symfony/panther to 0.9 (#1273) * Applied fixes from FlintCI (#1274) * DevKit updates for 3.x branch (#1275) * DevKit updates * Fix lint Co-authored-by: Vincent Langlet <vincentlanglet@hotmail.fr> Co-authored-by: Vincent Langlet <VincentLanglet@users.noreply.github.com> Co-authored-by: Vincent Langlet <vincentlanglet@hotmail.fr> Co-authored-by: Fran Moreno <franmomu@gmail.com> Co-authored-by: Sullivan SENECHAL <soullivaneuh@gmail.com> Co-authored-by: Sonata CI <thomas+ci@sonata-project.org>
Subject
I am targeting this branch, because BC.
getOptions
is usingarray_key_exist
sowill return
null
instead ofDateTimeFiler::class
when the type is guessed by our guesser.This issue was reported on slack by someone using the master branch and he tried the fix for me.
Changelog