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:
You need to have multiple languages / sites and changelanguage configured so you can switch between them
At least one archive for one of the languages / sites (depends if you want to reproduce 1. or 2.)
setup one news reader module to read all archives
add pages on both languages with the newsreader in it
If:
The current language has no archive
then the issue applies to code shown in 1. above
The current language has an archive but said archive does not have a news with the given alias
then the issue applies to code shown in 2. above
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).
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.
If either of those return null when you are on a news detail page
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).