- πΊπΈUnited States maskedjellybean Portland, OR
On ics_field 3.0.0, this patch does apply cleanly, however it creates an error that's thrown on most pages and results in my having to drop the database because even config import can't undo it.
Steps to reproduce:
- Apply patch.
- Add a Calendar download field to content type that has a date_recur field
- In field settings, select the date_recur field. The error will thrown after the AJAX request. In watch dog you'll see:
Error Drupal\Core\Field\FieldException: Attempted to create an instance of field with name field_ics_download on entity type node when the field storage does not exist. in Drupal\field\Entity\FieldConfig->getFieldStorageDefinition() (line 316 of /app/docroot/core/modules/field/src/Entity/FieldConfig.php)
This error will be shown on most subsequent page loads.
I'd also say that in order to actually support date_recur, we would want to add recurring events to the ICS file using RRULE. The date_recur module actually stores the RRULE string in the database in the field table, so we should be able to get it from there.
- πΊπΈUnited States maskedjellybean Portland, OR
I realized my previous comment is unrelated to this specific issue so I created a new one: https://www.drupal.org/project/ics_field/issues/3436571 π Field storage does not exist error Active
- Merge request !18Issue #2946641: Support date_recur field type. β (Open) created by maskedjellybean
- last update
about 1 year ago 47 pass, 3 fail - πΊπΈUnited States maskedjellybean Portland, OR
I've open a merge request:
https://git.drupalcode.org/project/ics_field/-/merge_requests/18#6bc0130...
Patch:
https://git.drupalcode.org/project/ics_field/-/merge_requests/18.patch
It expands on the patch from #4 to fully support date_recur field type by adding an RRULE property to the generated ICS file. With the addition of the RRULE property, every occurrence of an event will appear on the calendar, instead of only the first. This is what someone using a date_recur field would expect.
Other changes
Refactored dateslist/dates_list array structure
The dateslist/dates_list array structure is refactored from something like this:
[ "1970-01-01 01:00:00 Europe/Zurich", "1971-02-02 02:00:00 Europe/Zurich", ]
To something like this:
[ [ 'startdate' => "1970-01-01 01:00:00 Europe/Zurich", 'enddate' => "1970-01-01 02:00:00 Europe/Zurich", 'rrule' => 'RRULE:FREQ=DAILY;COUNT=10' ], [ 'startdate' => "1971-02-02 02:00:00 Europe/Zurich", 'enddate' => "1971-02-02 03:00:00 Europe/Zurich", 'rrule' => 'RRULE:FREQ=WEEKLY;COUNT=5' ], ]
This is because of the need to associate an RRULE with each start date of a multi value field. Additionally, an RRULE needs an end date, so that has been added as well. This may interfere/overlap with this issue. β¨ Include end date / time in ICS file. Needs work
I have not actually tested a multi value field, so this needs reviewing. With a date_recur field there is no need for multiple values since it allows you configure a pattern of occurrences based on the start date rather than several explicit start dates.
I tried to fix the tests, but I don't have a way to run phpunit at the moment so I probably messed up.
Fixed Outlook compatibility
The current version of the module generates ICS files that are incompatible with Outlook. Outlook will not import them. I have no idea how, but somehow I stumbled on a fix for this with my changes. Originally I was looking into fixing this the way that the addtocal_augment module fixed it, by not setting timezones, and instead setting dates using UTC π ics import problems due to malformed VTIMEZONE definition Fixed . However, that turned out to not be necessary.
- πΊπΈUnited States maskedjellybean Portland, OR
I found that Composer will not apply the patch generated from the merge request, so here is a manually created patch.
- last update
about 1 year ago 47 pass, 3 fail - πΊπΈUnited States maskedjellybean Portland, OR
New patch that fixes passing incorrect parameter type to \Eluceo\iCal\Property\Event\RecurrenceRule::setUntil
- last update
about 1 year ago 48 pass, 2 fail - πΊπΈUnited States maskedjellybean Portland, OR
Realized my change to
\Drupal\ics_field\ICalTimezoneGenerator::getMinMaxTimestamps
was causing the file to be generated withoutBEGIN:DAYLIGHT, TZOFFSETFROM
etc. Fixed with this patch.This made me realize why my changes appeared to fix Outlook support. It's because prior to this patch I had accidentally removed the
TZOFFSETFROM
property. This module formatsTZOFFSETFROM
incorrectly, which Outlook (at least Outlook for Mac) then refuses to import. By accidentally removing that property entirely I had "fixed" Outlook. Now I realize there's a separate issue for this: https://www.drupal.org/project/ics_field/issues/3004699 β - πΊπΈUnited States maskedjellybean Portland, OR
New patch reflecting latest changes in MR:
- Fix broken iCalTimezoneGeneratorTest. All tests now pass, at least locally.
- Fix use of array_shift() seemingly accidentally causing empty array by removing first element, which then caused no transitions to be generated. Update test to reflect new generated calendar string.
- Add test for generated calendar for a recurring event (Compares generated ICS file string to an expected string containing RRULE property which has been validated by https://icalendar.org/validator.html).
- Remove the addition of datetime and daterange to supported field types array because it is completely untested and seems outside the issue scope.