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.
Problem/Motivation
Follow-up from #2829848: Random test failure in DateRangeFieldTest. It should be possible to remove some logic from \Drupal\datetime_range\Plugin\Field\FieldWidget\DateRangeWidgetBase::massageFormValues() but this wasn't necessary to fix the critical bug.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | 2846963-07.patch | 6.49 KB | mpdonadio |
Comments
Comment #2
alexpottI think there's a lot of logic here that should occur in \Drupal\datetime_range\Plugin\Field\FieldType\DateRangeItem or in \Drupal\datetime\DateTimeComputed. It's also apparent that validation is occurring in the form layer - see \Drupal\datetime_range\Plugin\Field\FieldWidget\DateRangeWidgetBase::validateStartEnd() - this should be a constraint so Rest API etc get validated correctly.
Comment #3
mpdonadio#2830094: Deprecate and remove usages of datetime_date_default_time(). may overlap a lot with this issue.
Two related issues, #2824717: Add a format constraint to DateTimeItem to provide REST error message and #2832264: DateTimeItemTest is not valid with similar work.
Comment #4
alexpottAdded #2847041: Add a format and start/end validation constraints to DateRangeItem to provide helpful REST/JSON:API error message
Comment #7
mpdonadioMost of this was taken care of in #2830094: Deprecate and remove usages of datetime_date_default_time()., but this moves some inner loop invariants.
I think any other refactoring in this is contrived.
Comment #10
jhedstromQueued for re-testing. Assuming it comes back green I think this looks good-to-go.
Comment #11
jhedstromTests are still green. This looks good!
Comment #12
catchCommitted 19d6457 and pushed to 8.7.x. Thanks!