\Drupal\date_recur\DateRecurOccurrences occurrence generator sets time zone which causes internal data structure mutation on data range items.

DateRange should be immune to modification.

Should probably use DateTimeImmutable, but that would be an API change.. Interface allows this, but could break existing code if they ignored typehinting. This will be changed in a minor release.

For now, will instead date objects will be cloned on get call

Comments

dpi created an issue. See original summary.

dpi’s picture

Issue summary: View changes
dpi’s picture

Status: Active » Needs review
StatusFileSize
new1.74 KB
new2.23 KB
dpi’s picture

Title: DateRange are not immunie to mutation » DateRange are not immune to mutation

The last submitted patch, 3: 3136905-immutable-getters-test-only.patch, failed testing. View results

  • dpi committed 71f1eab on 8.x-2.x
    Issue #3136905 by dpi: DateRange are not immune to mutation
    
dpi’s picture

Version: 8.x-2.x-dev » 3.x-dev
Status: Needs review » Patch (to be ported)

  • dpi committed 78c1d27 on 3.x
    Issue #3136905 by dpi: DateRange are not immune to mutation
    
dpi’s picture

Assigned: dpi » Unassigned
Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

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