Skip to content

Commit

Permalink
Have to use parent classes to get current action/params for `LocaleLi…
Browse files Browse the repository at this point in the history
…nkGenerator` (#197)

Because `$this` ones are overwritten.

This was working before in #196 but I broke it in
a12a6cb by adding
`getLocaleLinkAction()` and `getLocaleLinkParams()`.
  • Loading branch information
spaze authored Aug 14, 2023
2 parents 1c87bc0 + 699a906 commit 12ea4d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion site/app/Www/Presenters/TalksPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public function actionTalk(string $name, ?string $slide = null): void
try {
$talk = $this->talks->get($name);
if ($talk->getLocale() !== $this->translator->getDefaultLocale()) {
$this->redirectUrl($this->localeLinkGenerator->links(...$this->getLocaleLinksGeneratorParams())[$talk->getLocale()]->getUrl(), IResponse::S301_MovedPermanently);
$links = $this->localeLinkGenerator->links(parent::getLocaleLinkAction(), parent::getLocaleLinkParams());
$this->redirectUrl($links[$talk->getLocale()]->getUrl(), IResponse::S301_MovedPermanently);
}
if ($talk->getSlidesTalkId()) {
$slidesTalk = $this->talks->getById($talk->getSlidesTalkId());
Expand Down

0 comments on commit 12ea4d7

Please sign in to comment.