Skip to content

Commit

Permalink
Merge pull request #225 from quantcdn/feature/views-prefix
Browse files Browse the repository at this point in the history
Added check for empty language prefix.
  • Loading branch information
kepol authored Jan 31, 2024
2 parents 2a3be47 + c129764 commit 48f0a25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/EventSubscriber/CollectionSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,12 @@ public function collectRoutes(CollectRoutesEvent $event) {
$base = \Drupal::request()->getBaseUrl();
$event->queueItem(['route' => $base . "/{$path}"]);

// Languge negotiation may also provide path prefixes.
// Language negotiation may also provide path prefixes.
if ($prefixes = \Drupal::config('language.negotiation')->get('url.prefixes')) {
foreach ($prefixes as $prefix) {
$event->queueItem(['route' => "/{$prefix}/{$path}"]);
if ($prefix) {
$event->queueItem(['route' => "/{$prefix}/{$path}"]);
}
}
}
}
Expand Down

0 comments on commit 48f0a25

Please sign in to comment.