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

[5.2] Allow access of default language home with "Remove lang code" parameter #43228

Open
wants to merge 1 commit into
base: 5.2-dev
Choose a base branch
from

Conversation

SniperSister
Copy link
Contributor

Summary of Changes

This PR suppresses the currently enforce dredirect to the language stored in the session (or language cookie) if the "/" page is called on a mulitlingual site with the "remove URL lang code"-parameter being enabled.

Testing Instructions

  1. configure a multilingual site
  2. configure the languagefilter plugin like this:
    • Language Selection for new Visitors: "site language"
    • Remove URL Language Code: "Yes"
  3. open a "private mode" browser window to ensure that you visit the site frontend without an existing session
  4. open the "/" URL of the site -> the default language will be used
  5. switch to the non-default language
  6. open the "/" URL of the site -> a redirect to the homepage of the non-default language is triggered

Actual result BEFORE applying this Pull Request

In step 6 of the instructions above, a redirect to the homepage of the non-default language is triggered

Expected result AFTER applying this Pull Request

In step 6 of the instructions above, the home page of the default language is opened.

@brianteeman
Copy link
Contributor

This does exactly what it says. However a negative side effect is that if you click on the site logo to get to the home page you will always go to the home page of the default language and not the home page pf the current language which is the existing behaviour and I would assume that is what you would want.

@brianteeman
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on eae25dd


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43228.

@brianteeman
Copy link
Contributor

This pr also breaks the error page.

switch to the non default language
go to a fake url to trigger the error page
click on the button to take you to the home page (see image)
with this pr you go to the home page of the default language not the home page of the current language which is a change in beahviour and one that I assume is undesired

image

@SniperSister
Copy link
Contributor Author

This does exactly what it says. However a negative side effect is that if you click on the site logo to get to the home page you will always go to the home page of the default language and not the home page pf the current language which is the existing behaviour and I would assume that is what you would want.

Well that's the key question here. Is the existing behavior a bug or a feature. Depending on the usecase they both have pros and cons.

@brianteeman
Copy link
Contributor

If you click on a button that says "home" then I would expect it to take it to the home page of the language in use. It would be very annoying if everytime you clicked home you had to change the language again. I recall that @infograf768 has spent a lot of time over the years ensuring that the site logo goes to the correct homepage. This is the way it has always behaved.

@HLeithner
Copy link
Member

if you remove the language prefix from the url you can't directly switch to the default language anymore right?
if you want to go to the "homepage" (default menu item) you should direct to this item and should be the correct language right?

using the removed language part behavior is a strange idea anyway but if people like to use it they have to use the right way to link to the Startpage.

just my opinion

@brianteeman
Copy link
Contributor

if you remove the language prefix from the url you can't directly switch to the default language anymore right?

wrong

@SniperSister
Copy link
Contributor Author

You can switch the language by using either the prefixed URL or the lang=FOOBAR query parameter.

However the current experience is inconsistent: depending on your session/cookie state, the same request ("GET /") will either return content or return a redirect. From an end-users perspective that's hardly understandable.

@HLeithner HLeithner changed the base branch from 5.1-dev to 5.2-dev April 24, 2024 09:06
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.2-dev.

@HLeithner
Copy link
Member

I know of course that you can add the ?lang= parameter... what I mean was it's not longer possible to change the language in a sef way.

@HLeithner HLeithner changed the title [5.1] Allow access of default language home with "Remove lang code" parameter [5.2] Allow access of default language home with "Remove lang code" parameter Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants