Skip to content
Snippets Groups Projects
Commit 3a61c4ef authored by Mike Decker's avatar Mike Decker
Browse files

#3461818 Respect GET parameters when doing redirect lookup for routes

parent 03fc19a5
No related branches found
No related tags found
1 merge request!90#3461818 Respect GET parameters when doing redirect lookup for routes
Pipeline #226672 passed
......@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Drupal\graphql_compose_routes\Plugin\GraphQL\DataProducer;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Path\PathValidatorInterface;
......@@ -119,8 +120,10 @@ class UrlOrRedirect extends DataProducerPluginBase implements ContainerFactoryPl
// Redirect module requires the current language code to get results.
$langcode = $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_URL)->getId();
$parsed_url = UrlHelper::parse(trim($path));
return $this->redirectRepository
? $this->redirectRepository->findMatchingRedirect($path, [], $langcode)
? $this->redirectRepository->findMatchingRedirect($parsed_url['path'], $parsed_url['query'], $langcode)
: NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment