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

Using EXT:redirects with a news article in a not default language as a target doesn't work #2501

Open
createdwithlove opened this issue Jul 5, 2024 · 3 comments
Labels

Comments

@createdwithlove
Copy link
Contributor

createdwithlove commented Jul 5, 2024

After reading the documentation up and down and forwards and backwards, I've come to the conclusion that it must be a bug somehow and hope, someone can help.

I have already started a topic on stackoverflow, but unfortunately there is no solution there: https://stackoverflow.com/questions/78422845/how-to-setup-routeenhancer-for-extnews-which-works-in-redirct-module-for-linkin

Here is a brief summary of the problem:
The links that are generated with EXT:redirect when you want to redirect to a news record in a foreign language are wrong.
The generated path is the one from the default language (e.g. https://mysite.com/news/article/) while the last part is the translated news title (e.g. mein-deutscher-beitrag).

The configurations from the following parts of the documentation are in use:
https://docs.typo3.org/p/georgringer/news/11.4/en-us/Tutorials/BestPractice/Routing/Index.html
https://docs.typo3.org/p/georgringer/news/11.4/en-us/Tutorials/BestPractice/Linkhandler/Index.html
https://docs.typo3.org/p/georgringer/news/11.4/en-us/Tutorials/BestPractice/PreviewOfRecord/Index.html
https://docs.typo3.org/p/georgringer/news/11.4/en-us/Tutorials/ExtendNews/DataProcessing/LanguageMenuProcessor.html

Another additional information:
Creating such a link in a rte field behaves like this:
translated page -> link to: translated news article -> works fine ✅
translated page -> link to: default language news article -> (correct) link to translated news article ❌
default language page -> link to: translated news article -> mixed link (as described above) ❌

Setting an additional param like L=1 doesn't seem to have any impact

@createdwithlove
Copy link
Contributor Author

If you take the faulty parts apart, it seems that the additionalParams are overwritten and therefore the L=1 is never taken into account.

config.recordLinks.tx_news {
    typolink {
        …
        # overwrites all additionalParams ->
        additionalParams.data = field:uid
        …
    }
}

With following workaround this behaviour is omitted:

additionalParams {
  wrap = &tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]={field:uid}&L={field:sys_language_uid}
  insertData = 1
}

Could someone else test this? What side effects could this cause?

@georgringer
Copy link
Owner

sorry my comment was completly bogus and I removed it

@createdwithlove
Copy link
Contributor Author

Removed mine too.

If you're fine with my solution from above, I could amend the documentation on this part(https://docs.typo3.org/p/georgringer/news/11.4/en-us/Tutorials/BestPractice/Linkhandler/Index.html#configuration-for-the-frontend)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants