Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm assuming that this is a problem in Date Views.
I have a View where the user can filter on a "Date" type field in content. I want to make the date an exposed filter, but oblige the user to enter a value for the filter. Although I have clicked on the "required" setting, the View runs anyway without any problem.
Comment | File | Size | Author |
---|---|---|---|
#1 | date-2536860-1.patch | 817 bytes | vaibhavjain |
|
Comments
Comment #1
vaibhavjainThe reason it does not work is because, #type is not added to the form element, instead added to a prefix, like min / max. This is by default, so I feel like this will be same issue, if there is a single date field.
In views, if #type exists, then only views code take certain actions, including the required setting.
I believe, because of this, there may be many more issues which may be occuring.
Adding the patch, which works well for me, however, there can be a better way of doing this.
Thanks
Comment #2
DamienMcKenna