terminal42 / contao-changelanguage

ChangeLanguage is an extension for the Contao CMS which allows visitors to switch between different languages of your website.
43 stars 36 forks source link

Issues with News #160

Closed mvscheidt closed 1 year ago

mvscheidt commented 5 years ago

If either of those return null when you are on a news detail page

  1. https://github.com/terminal42/contao-changelanguage/blob/master/library/Terminal42/ChangeLanguage/EventListener/Navigation/NewsNavigationListener.php#L47
  2. https://github.com/terminal42/contao-changelanguage/blob/master/library/Terminal42/ChangeLanguage/EventListener/Navigation/NewsNavigationListener.php#L53

Changelanguage will seemingly just go with the default generating behavior, meaning it generates alternate links for each language as if the newsentry was a normal contao page.

Prerequisites:

If:


In our case this happens because of 2, we use a single news reader for all newsarchives, which technically means you can pass any alias to the reader it and the reader will output the corresponding news entry.

However changelanguage doesn't know the actual "source" archive of the newsentry, if the entry is not within an archive that has the jumpTo of the current page.


Note

I mostly wrote this from the top of my head after debugging and didn't setup an entirely clean system to reproduce it with a minimal setup.

I'll have to see if I can somehow set up an reproducer once I got some time, unless you do not require it because this issue is clear enough (I'm not sure if it is).

aschempp commented 1 year ago

since this is an outdated issue and I'm unsure what to do with it, I'll close this for now. Please feel free to follow up if this still is an issue in the latest version.