Skip to content
Snippets Groups Projects

Issue #3378529 - Fix multiple parameters

1 file
+ 11
6
Compare changes
  • Side-by-side
  • Inline
@@ -125,14 +125,18 @@ class TrailingSlashOutboundPathProcessor implements OutboundPathProcessorInterfa
$active_bundles = TrailingSlashSettingsHelper::getActiveBundles();
if (!empty($active_bundles)) {
$url = Url::fromUri('internal:' . $path);
try {
if ($url->isRouted() && $params = $url->getRouteParameters()) {
$entity_type = key($params);
if (array_key_exists($entity_type, $active_bundles)) {
$entity = $this->entityTypeManager->getStorage($entity_type)->load($params[$entity_type]);
$bundle = $entity->bundle();
if (isset($active_bundles[$entity_type][$bundle])) {
return TRUE;
$entity_types = array_keys($params);
foreach ($entity_types as $entity_type) {
if (array_key_exists($entity_type, $active_bundles) &&
$entity = $this->entityTypeManager->getStorage($entity_type)->load($params[$entity_type])
) {
if (isset($active_bundles[$entity_type][$entity->bundle()])) {
return TRUE;
}
}
}
}
@@ -140,6 +144,7 @@ class TrailingSlashOutboundPathProcessor implements OutboundPathProcessorInterfa
catch (\Exception $e) {
}
}
return FALSE;
}
Loading