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

On event detailpages Url counts auto_item more then one parameter #259

Open
Ainschy opened this issue Sep 5, 2024 · 9 comments
Open

On event detailpages Url counts auto_item more then one parameter #259

Ainschy opened this issue Sep 5, 2024 · 9 comments

Comments

@Ainschy
Copy link

Ainschy commented Sep 5, 2024

Contao 4.13.47

effected by 3.7.7 and 3.7.8

https://github.com/terminal42/contao-changelanguage/blob/6617862bc236d24c54aefa4b45519dd670741698/src/Navigation/UrlParameterBag.php#L140-L153

auto_item counts two keys
events, item

3.7.6 and earlier versions have only events as key for auto_item

@aschempp
Copy link
Member

aschempp commented Sep 6, 2024

auto_item counts two keys
events, item

3.7.6 and earlier versions have only events as key for auto_item

könntest du das etwas genauer beschreiben?

@Ainschy
Copy link
Author

Ainschy commented Sep 6, 2024

Ok, ich habe es mir noch mal genauer angeschaut. Der Fehler tritt auf wenn ich die Erweiterung: https://github.com/iMi-digital/imi_mm_changelanguage mit installiert habe. Diese Erweiterung brauchen wir für die MetaModel Detaillseiten und sie verwendet den changelanguageNavigation-Hook.

Als Rückgabewert wird der key items übergeben, was bei MM korrekt ist, aber im Sprachwechsler nun anderes verarbeitet wird.
https://github.com/iMi-digital/imi_mm_changelanguage/blob/0737f11b8f7dcdcafdf3aba478a72e2d94ec627d/contao/classes/ImiMMChangeLanguageObserver.php#L176

Sieht für mich nach einen BC Break im Hook aus?

Edit:
Laut Beschreibung wird items als key erwartet:
https://extensions.terminal42.ch/docs/changelanguage/en/developers/#rewriting-an-url-parameter

@fritzmg

This comment was marked as off-topic.

@aschempp
Copy link
Member

@Ainschy wer setzt denn events in deinem System auf dem Hook?

@fritzmg
Copy link
Sponsor Contributor

fritzmg commented Sep 21, 2024

@aschempp ChangeLanguage does:

return isset($GLOBALS['TL_CONFIG']['useAutoItem']) ? 'events' : 'auto_item';

Why was my comment marked off-topic?

@aschempp
Copy link
Member

The CalendarNavigationListener should be triggered in this place though (or at least not by the recent changes).

@fritzmg
Copy link
Sponsor Contributor

fritzmg commented Sep 21, 2024

Not sure what you mean - ChangeLanguage itself sets the events URL key in the URL parameter bag (presumably because Contao itself uses events as well, not items - see #259 (comment)). The other extension then additionally adds items, resulting in two URL parameters.

@Ainschy
Copy link
Author

Ainschy commented Sep 21, 2024

https://extensions.terminal42.ch/docs/changelanguage/en/developers/#rewriting-an-url-parameter sagt das items gesetzt werden soll, ggf. muss hier ein bestehende key wie in diesem Fall events abgefragt werden. Die betroffene Erweiterung setzt wie in der Doku beschrieben items als key und damit kommt der zweite Parameter ins Spiel.

@Ainschy
Copy link
Author

Ainschy commented Sep 21, 2024

@Ainschy wer setzt denn events in deinem System auf dem Hook?

Die imi_mm_changelanguage Erweiterung prüft bei jedem Seitenaufruf ob es ein MetaModel Modul auf der Seite gibt und gibt als Fallback immer items als Parameter zurück. Sicher nicht optimal gelöst, hat bisher aber zu keinen Problem geführt.

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

No branches or pull requests

3 participants