- Issue created by @bburg
IcalFieldsWizard::createDefaultEvent() contains this line of code:
$rruleHelper = $entity->field_recur[0]->getHelper();
It would seem that "field_recur" in this case is a reference to a field that just happens to have the machine name "field_recur". Which is also presumes is a field provided by the Recurring Dates Field β module.
I'm frankly very surprised that this hasn't come up sooner, but this would certainly break if anyone named the field something besides "field_recur", or mapped the recurring date field to some field that had a field type of something not provided by that module. Earlier in this section of code, it also explicitly looks at the body field:
if ($this->fieldMapping['rrule_field'] == 'body') {
$rrule = $entity->get('body')->getValue()[0]['value'];
$event->addRecurrenceRule($rrule);
}
Ideally, we just look at the field mapped to the rrule field, check that field's type, and use an appropriate handler to pass that recurring rule to the appropriate event constructor.
Note, this was noticed while we are upgrading the module to work with the 2.x version of Eluceo/ical. As of now, which VIews iCal uses to render it's output in icalendar format. As of this writing, that library does not support recurring rules in events. See #3209012: Move to eluceo/ical 2.0 β
Active
1.0
Code