Skip to content
Snippets Groups Projects
Commit 794ed0f7 authored by Owen Bush's avatar Owen Bush Committed by Owen Bush
Browse files

Issue #3126369 by owenbush, the_glitch: white screen error when visiting...

Issue #3126369 by owenbush, the_glitch: white screen error when visiting Registrations page of deleted event
parent 76f1d0fc
No related branches found
No related tags found
No related merge requests found
...@@ -61,23 +61,25 @@ function recurring_events_views_views_query_alter(ViewExecutable $view, QueryPlu ...@@ -61,23 +61,25 @@ function recurring_events_views_views_query_alter(ViewExecutable $view, QueryPlu
if (!empty($eventinstance_id)) { if (!empty($eventinstance_id)) {
$eventinstance = \Drupal::entityTypeManager()->getStorage('eventinstance')->load($eventinstance_id); $eventinstance = \Drupal::entityTypeManager()->getStorage('eventinstance')->load($eventinstance_id);
$service = \Drupal::service('recurring_events_registration.creation_service'); if (!empty($eventinstance)) {
$service->setEventInstance($eventinstance); $service = \Drupal::service('recurring_events_registration.creation_service');
switch ($service->getRegistrationType()) { $service->setEventInstance($eventinstance);
case 'instance': switch ($service->getRegistrationType()) {
$field = 'registrant.eventinstance_id'; case 'instance':
$value = [ $field = 'registrant.eventinstance_id';
$eventinstance->id(), $value = [
]; $eventinstance->id(),
break; ];
break;
case 'series': case 'series':
default: default:
$field = 'registrant.eventseries_id'; $field = 'registrant.eventseries_id';
$value = [ $value = [
$eventinstance->getEventSeries()->id(), $eventinstance->getEventSeries()->id(),
]; ];
break; break;
}
} }
if (!empty($field) && !empty($value)) { if (!empty($field) && !empty($value)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment