Default start and end date functionality inherited from datetime_range does not work.

Default values are not being set because widget trips on lack of time zone.

Needs widget and programmatic tests

Comments

dpi created an issue. See original summary.

dpi’s picture

Assigned: Unassigned » dpi

This is WIP

dpi’s picture

Status: Active » Needs review
StatusFileSize
new8.16 KB

Patch adds time zone field for default values, in addition to default time zone for #3021114: Allow specifying a time zone for default field value.

Tests WIP.

Status: Needs review » Needs work

The last submitted patch, 3: 3018426-default-time-zones.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dpi’s picture

Status: Needs work » Needs review
StatusFileSize
new9.51 KB
new15.46 KB

Removed time override option and tests from basic widget.

Status: Needs review » Needs work

The last submitted patch, 5: 3018426-default-time-zones-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dpi’s picture

Status: Needs work » Needs review
StatusFileSize
new8.9 KB
new8.9 KB
new23.28 KB

Status: Needs review » Needs work

The last submitted patch, 7: 3018426-default-time-zones-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dpi’s picture

Providing a way to have field defaults which arnt wiped out before form display (via filterEmptyItems) has proven especially difficult.

In order for defaults to appear, an entire field value must be considered valid, that means a default start date, end date, and time zone must be provided. Rrule is optional.

One workaround for displaying sensible defaults in widgets is to detect if entity is new and field column is NULL, then setting a default there. However we have to be careful that the magic second field value in unlimited cardinality fields isnt also saved because its not considered empty.

dpi’s picture

I'm considering adding default field value logic to DateRecurItem::appendItem (for when WidgetBase calls it), then in any DR fields making sure unlimited cardinality fields dont get a magic second empty value. Perhaps as a follow up, and alternative to the default time zone feature removed from basic widget in this patch.

Fields items added via AJAX seem to be exempt from filterEmptyItems so even invalid values from appendItem show up.

dpi’s picture

dpi’s picture

dpi’s picture

Status: Needs work » Needs review
StatusFileSize
new759 bytes
new23.29 KB

Fix test.

dpi’s picture

  • dpi committed 83a4ad6 on 8.x-2.x
    Issue #3018426 by dpi: Added default start date, end dates, time zone.
    
  • dpi committed d7c5a9e on 8.x-2.x
    Issue #3018426 by dpi: Removed time zone override settings from widget...
dpi’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

azovsky’s picture

Looks like this is still not working. I setup default values via UI, but for new nodes with a date_recur field is empty (date-time & timezone).

dureaghin’s picture

dureaghin’s picture