Problem/Motivation
After switching to PHP 8 we cannot save or edit events.
Getting the following errors.
TypeError: Cannot access offset of type string on string in Drupal\recurring_events\Plugin\Field\FieldWidget\ConsecutiveRecurringDateWidget->validateForm() (line 321 of /var/www/html/web/modules/contrib/recurring_events/src/Plugin/Field/FieldWidget/ConsecutiveRecurringDateWidget.php)
Error: Call to a member function format() on null in Drupal\recurring_events\Plugin\Field\FieldType\ConsecutiveRecurringDate::buildDiffArray() (line 189 of /var/www/html/web/modules/contrib/recurring_events/src/Plugin/Field/FieldType/ConsecutiveRecurringDate.php)
ypeError: Drupal\recurring_events\Plugin\Field\FieldType\ConsecutiveRecurringDate::findDailyDatesBetweenDates(): Argument #1 ($start_date) must be of type Drupal\Core\Datetime\DrupalDateTime, null given, called in /var/www/html/web/modules/contrib/recurring_events/src/Plugin/Field/FieldType/ConsecutiveRecurringDate.php on line 256 in Drupal\recurring_events\Plugin\Field\FieldType\ConsecutiveRecurringDate::findDailyDatesBetweenDates() (line 299 of /var/www/html/web/modules/contrib/recurring_events/src/Plugin/Field/FieldType/ConsecutiveRecurringDate.php)
Steps to reproduce
Switch to PHP8.0 and try to save an event.
Proposed resolution
Adding a patch with the fix.
Remaining tasks
Running tests.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | recurring_events_3301983-1.patch | 7.21 KB | binnythomas |
Comments
Comment #2
binnythomas commentedAttaching patch with fixes.
Comment #3
binnythomas commentedComment #4
owenbush commentedThank you for the issue and patch.
Comment #7
owenbush commentedThis has been merged, thank you.