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
if (!empty($eventinstance_id)) {
$eventinstance = \Drupal::entityTypeManager()->getStorage('eventinstance')->load($eventinstance_id);
$service = \Drupal::service('recurring_events_registration.creation_service');
$service->setEventInstance($eventinstance);
switch ($service->getRegistrationType()) {
case 'instance':
$field = 'registrant.eventinstance_id';
$value = [
$eventinstance->id(),
];
break;
if (!empty($eventinstance)) {
$service = \Drupal::service('recurring_events_registration.creation_service');
$service->setEventInstance($eventinstance);
switch ($service->getRegistrationType()) {
case 'instance':
$field = 'registrant.eventinstance_id';
$value = [
$eventinstance->id(),
];
break;
case 'series':
default:
$field = 'registrant.eventseries_id';
$value = [
$eventinstance->getEventSeries()->id(),
];
break;
case 'series':
default:
$field = 'registrant.eventseries_id';
$value = [
$eventinstance->getEventSeries()->id(),
];
break;
}
}
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