From 38d3ac1c0a62511dff10a71be4ebde9d1e9680c3 Mon Sep 17 00:00:00 2001 From: Julian Pustkuchen Date: Tue, 20 Feb 2018 10:02:34 +0100 Subject: [PATCH] Drupal 8.5 compatibility Don't assume that $defaults['event'] exists. Otherwise routes may break. Fall back to default if it does not exist. --- src/Routing/Enhancer/RngRouteEnhancer.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Routing/Enhancer/RngRouteEnhancer.php b/src/Routing/Enhancer/RngRouteEnhancer.php index b508eec..153f79e 100644 --- a/src/Routing/Enhancer/RngRouteEnhancer.php +++ b/src/Routing/Enhancer/RngRouteEnhancer.php @@ -22,13 +22,13 @@ public function applies(Route $route) { * {@inheritdoc} */ public function enhance(array $defaults, Request $request) { - $event_entity_type = $defaults['event']; - - if (isset($defaults[$event_entity_type])) { - $rng_event = $defaults[$event_entity_type]; - $defaults['rng_event'] = $rng_event; + if(!empty($defaults['event'])){ + $event_entity_type = $defaults['event']; + if (isset($defaults[$event_entity_type])) { + $rng_event = $defaults[$event_entity_type]; + $defaults['rng_event'] = $rng_event; + } } - return $defaults; }