Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Add optional language parameter to route_load data producer #1328

Merged

Conversation

ralphvandenhoudt
Copy link
Contributor

No description provided.

@Kingdutch Kingdutch added the 4.x label Apr 15, 2023
Copy link
Contributor

@klausi klausi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I have 2 minor comments that I will fix in a follow-up.

* @param \Drupal\Core\Cache\RefinableCacheableDependencyInterface $metadata
*
* @return \Drupal\Core\Url|null
*/
public function resolve($path, RefinableCacheableDependencyInterface $metadata) {
$redirect = $this->redirectRepository ? $this->redirectRepository->findMatchingRedirect($path, []) : NULL;
public function resolve($path, $language, RefinableCacheableDependencyInterface $metadata) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use type hints for all new parameters, in this case string.

* ),
* "language" = @ContextDefinition("string",
* label = @Translation("Language"),
* required = FALSE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should specify a default value und here, which is Language::LANGCODE_NOT_SPECIFIED

@klausi klausi merged commit 24f86e2 into drupal-graphql:8.x-4.x Nov 12, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants