Problem/Motivation
Error when viewing admin view for Registrants at /admin/content/events/registrations
Error: Call to a member function setTimezone() on string in Drupal\recurring_events_registration\RegistrantListBuilder->buildRow() (line 119 of modules/contrib/recurring_events/modules/recurring_events_registration/src/RegistrantListBuilder.php).
Lines in question is:
$date = $instance?->date->start_date ?? '';
$date->setTimezone($timezone);
$date can return empty string so this can fail.
Steps to reproduce
Install Recurring Events Views and visit /admin/content/events/registrations
Proposed resolution
Add condition to stop failure.
Comments
Comment #2
chrisla commentedComment #4
chrisla commentedPotential fix added in MR. For now, this fixes the fact that eventseries, eventinstance and therefore $date can be NULL. Not sure how I got a Registrant with NULL values, but since it is possible, this buildRow() method should check for that.