telerik / kendo-ui-core

An HTML5, jQuery-based widget library for building modern web apps.
http://www.telerik.com/kendo-ui
Other
2.54k stars 1.91k forks source link

"Contains" filter and null #6095

Open kendo-bot opened 3 years ago

kendo-bot commented 3 years ago

Enhancement

FIltering a string field in the Grid with Contains operators and value null throws an error

Reported in 1492459

Current behavior

FIltering a string field in the Grid with Contains operators and value null throws an error image

https://demos.telerik.com/aspnet-mvc/grid/remote-data-binding

Expected/desired behavior

An error shall not be thrown

Environment Kendo UI version: [all] Browser: [all]

gyankov commented 2 years ago

Issue only replicates when schema.model.fields.type is specified as the field parser is used in this scenario.

Behavior is introduced with the following fix:

https://github.com/telerik/kendo/commit/34443183eeee99c9aa75f9fac9c6657721af573c#diff-a0d075ee1d24c9eb1db889c41def1b3cda0bf4ce6966ec38d7957e45088834d2R664

a-witkowski commented 10 months ago

@ag-petrov, @gyankov, Hello. Is there any plan for when this bug will be fixed? I upgraded the application from .net framork to .net core and it stopped working correctly. In the previous version it looked like this: image

gyankov commented 10 months ago

Hi @a-witkowski, this behavior was introduced when we implemented null filtering. Thus, we parse "null" strings to actual null values. Reverting it is not an option, we could, however, add a setting to the datasource, that when set explicitly, will not parse "null" strings to nulls. Would that work for you?

I am raising the priority of this report, and I will discuss with them any other options that might not require additional configuration.

a-witkowski commented 10 months ago

Hi, @gyankov. it might work. The reason is that the real data does contain strings with the value "null", because there are no forbidden words, the user can enter any text. And users enter exactly "null" to see that a value has been entered, but it is empty. Stupid solution, but as it is.....