core icon indicating copy to clipboard operation
core copied to clipboard

`DateFilter` does not work sometimes until the cache is cleared.

Open Crovitche-1623 opened this issue 1 year ago • 0 comments

API Platform version(s) affected: 3.3.7

Description
Sometimes, the DateFilter simply doesn't work. I saw the parameters sent in the profiler but when I look at the Doctrine tab, the filter is not applied to the SQL query as expected. From my frontend, I expect one result, so it's a problem. Does anyone have a clue where I can search to debug this ?

How to reproduce
I have the following filter:

#[ApiFilter(DateFilter::class, properties: [
    'startAt' => DateFilterInterface::EXCLUDE_NULL,
    'endAt' => DateFilterInterface::INCLUDE_NULL_AFTER,
])]

Possible Solution
I don't know why but the problem is solved only when I clear the cache.

Additional Context I saw in some filters (for instance the SearchFilter) that invalid values are logged instead of a thrown exception, but I do not see any logs concerning my filter in my app.

image

Crovitche-1623 avatar Jul 09 '24 15:07 Crovitche-1623