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

EWPP-3180: Use route match to get the language switch links. #141

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

nagyad
Copy link
Member

@nagyad nagyad commented Mar 17, 2023

No description provided.

drishu
drishu previously approved these changes Mar 17, 2023
sergepavle
sergepavle previously approved these changes Mar 17, 2023
@@ -62,8 +62,7 @@ public function __construct(LanguageManagerInterface $language_manager, PathMatc
* Array of available translation links.
*/
public function getAvailableEntityLanguages(EntityInterface $entity) {
$route_name = $this->pathMatcher->isFrontPage() ? '<front>' : '<current>';
$links = $this->languageManager->getLanguageSwitchLinks(LanguageInterface::TYPE_CONTENT, Url::fromRoute($route_name));
$links = $this->languageManager->getLanguageSwitchLinks(LanguageInterface::TYPE_CONTENT, Url::fromRouteMatch(\Drupal::routeMatch()));
Copy link
Contributor

Choose a reason for hiding this comment

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

In order to expedite things, this can stay as it is for now. However, the path matcher is no longer needed in this class and you should inject the route match. So you should open a followup to fix it.

@nagyad nagyad dismissed stale reviews from sergepavle and drishu via d88db2f March 17, 2023 10:00
@nagyad nagyad merged commit 92eb1f9 into master Mar 17, 2023
@nagyad nagyad deleted the EWPP-3180 branch March 17, 2023 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants