Skip to content
Snippets Groups Projects

#3461818 Respect GET parameters when doing redirect lookup for routes

Merged Mike Decker requested to merge issue/graphql_compose-3461818:3461818-route-lookup-does into 2.2.x
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
@@ -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;
}
Loading