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.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chrisla created an issue. See original summary.

chrisla’s picture

Assigned: Unassigned » chrisla

chrisla’s picture

Assigned: chrisla » Unassigned
Status: Active » Needs review

Potential 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.