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.

CommentFileSizeAuthor
#2 recurring_events_3301983-1.patch7.21 KBbinnythomas

Comments

binnythomas created an issue. See original summary.

binnythomas’s picture

StatusFileSize
new7.21 KB

Attaching patch with fixes.

binnythomas’s picture

Status: Active » Needs review
owenbush’s picture

Thank you for the issue and patch.

  • owenbush committed 7b3012e on 2.0.x authored by binnythomas
    Issue #3301983 by binnythomas, owenbush: PHP 8.0 compatiblity issues -...

  • owenbush committed dbd65fb on 8.x-1.x authored by binnythomas
    Issue #3301983 by binnythomas, owenbush: PHP 8.0 compatiblity issues -...
owenbush’s picture

Status: Needs review » Fixed

This has been merged, thank you.

Status: Fixed » Closed (fixed)

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