Problem/Motivation
While developing a datetime Better Exposed Filter (#3500976: Build a DatetimePicker plugin to also handle time ), I noticed that the default offset value was not applied when no value was submitted.
I tried to use hooks like hook_views_pre_view(), hook_views_pre_execute() but acceptExposedInput() was always overriding the value $handler->value['value'] to null
Steps to reproduce
Proposed resolution
If the filter was not submitted but has default offset values, apply them so backends receive resolved dates.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3578444
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3578444-date-filter-doesnt
changes, plain diff MR !15055
Comments
Comment #3
macsim commentedComment #4
macsim commentedComment #5
smustgrave commentedThanks for reporting and opening with test coverage!
Left a small comment on the MR.
Comment #6
macsim commentedThanks for the review.
I applied your suggestion
Comment #7
smustgrave commentedThanks feedback appears to be addressed and much simpler
Comment #8
lendudeLooks good, just left one minor thing to improve the test coverage
Comment #9
macsim commentedI added a node beyond the max offset to check that point
Comment #10
lendudeThank you! Back to RTBC
Comment #11
alexpottNice find and fix. I ran some tests to ensure that the new code didn't generate PHP warnings about things not being set - all looks good.
Committed and pushed ec09b79130e to main and 3e792f7bcda to 11.x and 9a9b46d95c7 to 11.3.x. Thanks!