Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Always redirect front pages #134

Open
Biont opened this issue Jul 14, 2015 · 0 comments
Open

Always redirect front pages #134

Biont opened this issue Jul 14, 2015 · 0 comments

Comments

@Biont
Copy link
Member

Biont commented Jul 14, 2015

MLP currently shows inconstistent behaviour when redirecting Users:

Using a static front page with missing content relation on all sites:

  • Have at least one site display a static front page ( wp-admin/options-reading.php )
  • This page is not linked to a page on the remote site you wish to redirect to

MLP will fail to redirect to the front page of the remote site, even though all other related settings have been set up correctly. This is because Mlp_Language_Negotiation::get_fallback_match() returns an empty URL if no matching content has been found, causing Mlp_Redirect_Response::redirect() to bail without further notice.

This behaviour differs from what the Language Switcher, Quicklinks - or more precisely Mlp_Helpers::show_linked_elements() would do: Redirect/Link to the home URL of the remote site.

Instead, the redirect feature simply does nothing at all, causing confusion among our users. Without being given any clue as to what went wrong, they might assume the feature is broken entirely and something is wrong with the MLP settings or the configuration of the Language Manager.

The obvious solution would be to make Mlp_Language_Negotiation::get_fallback_match() return the home URL of the most appropriate language/site and thus, mimick the behaviour of Mlp_Helpers::show_linked_elements().

But there's an edge case:

Using a static front page on one site, but with intact content relation:

Another implication of this behaviour is that it is currently not possible to have 2 sites use different setups for their front page:

  • Site A uses a static front page
  • Site B uses the regular "recent posts" view
  • The front page of site A has a working translation on site B

Now I am not sure if there is an actual use case for this kind of setup, but it poses a noteworthy question: What is the priority of "I am on the front page" vs. "There is a matching translation for the current content"? Does it differ between redirecting new users and showing translated content using Mlp_Helpers::show_linked_elements()?

The reason this setup is impossible is because a redirect to the home URL is merely a fallback if no Content ID is present. (And we're currently not even doing that, as pointed out above)

You could argue that new visitors should always be sent to their preferred language. And if they opened the home URL, that intention should be honored, instead of redirecting them "somewhere else".

But if a redirect to home is just a fallback, MLP would potentially ignore the intentions of both the visitor and the site owner (since he decided to use different front pages)

If we decide to consider this edge-case, the solution would probably be slightly more complex, but I haven't looked into it yet

@Biont Biont added this to the 2.2.1 milestone Jul 14, 2015
@tfrommen tfrommen modified the milestones: 2.3.0, 2.2.1 Aug 20, 2015
@tfrommen tfrommen modified the milestones: v2.4.0, v2.3.0 Nov 25, 2015
@tfrommen tfrommen removed this from the v2.4.0 milestone Mar 7, 2016
@Dinamiko Dinamiko added this to the v2.11.2 milestone Aug 27, 2018
@Dinamiko Dinamiko modified the milestones: v2.11.2, v2.11.3 Nov 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants