b13 / link2language

Allows to set links to a specific language of a page in FormEngine and the RTE link selector
GNU General Public License v2.0
17 stars 9 forks source link

Link to default language is not working. #10

Closed darthnorman closed 1 year ago

darthnorman commented 2 years ago

TYPO3 10.4 link2language 2.0.0 fallbackType is set to 'strict'

If I want to set a link inside a translated element and want to point the link to a page in the default langauge (it has no translation), shouldn't the extension set the L-parameter to 0? Because in this line is does not:

https://github.com/b13/link2language/blob/acbf6af62bb81dae8d4479131081f0ba1353de77/Classes/LinkHandler/PageLinkHandler.php#L94

If the parameter isn't set, the link is not rendered, since the page TYPO3 wants to show is not translated. Setting l18n_cfg to "show page even if no translation is available" doesn't help (which is weird).

lorenzulrich commented 1 year ago

Same here. link2language should set L=0 if we link from a non-default language to the default language.

lorenzulrich commented 1 year ago

@bmack What is your opinion on this? Should I just create a composer patch for our environment or are you interested in having this in the extension?

bmack commented 1 year ago

Sorry for being so silent (I do have quite a few projects to maintain on GitHub ;)).

Basically, totally fine, I guess we would need to adapt this one: https://github.com/b13/link2language/blob/acbf6af62bb81dae8d4479131081f0ba1353de77/Classes/LinkHandler/PageLinkHandler.php#L98

and add language=0 there.

lorenzulrich commented 1 year ago

@bmack Thanks and very well. My colleague @fanat98 provided a PR.