File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/Plugin/GraphQL/DataProducer/Routing Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 33namespace Drupal \graphql \Plugin \GraphQL \DataProducer \Routing ;
44
55use Drupal \Core \Cache \RefinableCacheableDependencyInterface ;
6+ use Drupal \Core \Language \Language ;
67use Drupal \Core \Path \PathValidatorInterface ;
78use Drupal \Core \Plugin \ContainerFactoryPluginInterface ;
89use Drupal \graphql \Plugin \GraphQL \DataProducer \DataProducerPluginBase ;
2728 * ),
2829 * "language" = @ContextDefinition("string",
2930 * label = @Translation("Language"),
30- * required = FALSE
31+ * required = FALSE,
32+ * default_value = "und"
3133 * )
3234 * }
3335 * )
@@ -94,12 +96,13 @@ public function __construct(
9496 * Resolver.
9597 *
9698 * @param string $path
97- * @param string $language
99+ * @param string|null $language
98100 * @param \Drupal\Core\Cache\RefinableCacheableDependencyInterface $metadata
99101 *
100102 * @return \Drupal\Core\Url|null
101103 */
102- public function resolve ($ path , $ language , RefinableCacheableDependencyInterface $ metadata ) {
104+ public function resolve ($ path , ?string $ language , RefinableCacheableDependencyInterface $ metadata ) {
105+ $ language = $ language ?? Language::LANGCODE_NOT_SPECIFIED ;
103106 $ redirect = $ this ->redirectRepository ? $ this ->redirectRepository ->findMatchingRedirect ($ path , [], $ language ) : NULL ;
104107 if ($ redirect !== NULL ) {
105108 $ url = $ redirect ->getRedirectUrl ();
You can’t perform that action at this time.
0 commit comments