?
avatar elpescador-nl
elpescador-nl
15 Jun 2021

Steps to reproduce the issue

Make a multilingual website:

  • Install new language
  • Create a content language
  • Enable the Language Filter plugin (associations = yes, makes it easier to see the result)
  • Activate sef + sef_suffix (+ sef_rewrite) in the global configuration

Expected result

Associations and links in mod_languages to the default (home) pages of different languages should be:

The .html suffix only with deep links to non default pages:

Actual result

Associations and links in mod_languages to the default pages are like:

System information (as much as possible)

  • Joomla! 4.0.0-rc1 Release Candidate [ MaƱana ] 1-June-2021 20:36 GMT
  • PHP 7.4.10
  • nginx/1.19.2
  • fpm-fcgi

Additional comment

I was wondering if the problem lies in the Language Filter plugin or in the sef_suffix logic.

avatar elpescador-nl elpescador-nl - open - 15 Jun 2021
avatar joomla-cms-bot joomla-cms-bot - change - 15 Jun 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Jun 2021
avatar brianteeman
brianteeman - comment - 15 Jun 2021

Confirmed for the home pages with the following config

image

avatar elpescador-nl elpescador-nl - change - 15 Jun 2021
Title
When Language Filter with sef_suffix are active base URL's are like /en.html
[4.0] When Language Filter with sef_suffix are active base URL's are like /en.html
avatar elpescador-nl elpescador-nl - edited - 15 Jun 2021
avatar elpescador-nl
elpescador-nl - comment - 15 Jun 2021

Additionally... without the sef_suffix the URL's are like:

...whereas these should have a trailing slash (in J!3.9 there is):

The buildFormat() function in the SiteRouter adds the format (.html) in case there is no trailing slash, so I don't think the issue is in that part. I can't find why there is no trailing slash in the default/home pages yet.

avatar joeforjoomla
joeforjoomla - comment - 15 Jun 2021

Confirmed.
Actually the home links are totally broken compard to J3 on a multilanguage J4 website, plus the language switcher module throws a 404 page when changing the language.

So bad to find this issue at a RC stage, this makes it impossible to use J4 on a multilanguage website or update from a J3 multilanguage website, a lot of penalties about SEO would occur because of duplicated home page links.

Additionally there are other issues such as the logo linking to the website home page without /en,/es suffix, menwhile the menu link to en.html, es.html

This issue should be marked as release blocker.

avatar wilsonge
wilsonge - comment - 15 Jun 2021

Actually the home links are totally broken compard to J3 on a multilanguage J4 website, plus the language switcher module throws a 404 page when changing the language.

This I can't reproduce at all.

I can fully reproduce the issue in the original report here - so it's a release blocker. But yeah there's no 404's. Just the SEF URLs not being as expected.

cc @Hackwar

avatar wilsonge wilsonge - change - 15 Jun 2021
Labels Added: ?
avatar wilsonge wilsonge - labeled - 15 Jun 2021
avatar richard67
richard67 - comment - 16 Jun 2021

Would be good to know when it was broken, with rc1 or before.

avatar joeforjoomla
joeforjoomla - comment - 16 Jun 2021

@richard67 this has always been broken, since the ALPHA stages of J4.

avatar brianteeman
brianteeman - comment - 16 Jun 2021

thank you for reporting it back then

avatar richard67
richard67 - comment - 17 Jun 2021

I am not sure if the "en.html", "es.html" and so on was a deliberate decision or not ... I've tried to find old issues and PR where that was discussed, but I was not successful yet.

If you ask me: Personally I'd prefer it to work like in J3 regarding the home pages, which is (as far as I understand) what @elpescador-nl wants, too.

What we have now in J4 is at least not consistent (if not broken): The language switcher links to e.g. "es.html" and "nl.html" for the other languages if current language is English, but if you click on the logo, the language filter brings you e.g. to "en/" instead of "en.html", and there the mess begins.

avatar brianteeman
brianteeman - comment - 17 Jun 2021

its clearly a bug

avatar brianteeman
brianteeman - comment - 17 Jun 2021

I believe the problem is in the test here

if (!(substr($route, -9) === 'index.php' || substr($route, -1) === '/') && $format = $uri->getVar('format', 'html'))

Although in reality the real problem is that the url for the home page in another language is
example.com/fr

when the test is expecting it to be
example.com/fr/

Note the trailing slash

avatar elpescador-nl
elpescador-nl - comment - 17 Jun 2021

Although in reality the real problem is that the url for the home page in another language is
example.com/fr

when the test is expecting it to be
example.com/fr/

Note the trailing slash

As I observed in an earlier post I think the real problem indeed is the absence of the trailing slash in home/default page url's. The decision of whether or not to add the .html suffix is just based on the absence/presence of the trailing slash.

avatar brianteeman
brianteeman - comment - 17 Jun 2021

Please test #34538

avatar richard67
richard67 - comment - 18 Jun 2021

Alternative PR is #34558 . It will be ready for test soon.

Update: No, doesn't work (yet).

Update 2: Now it works. I only don't know if my PR is the right way to fix the issue.

avatar richard67
richard67 - comment - 18 Jun 2021

Closing as having a pull request. Please test #34558 . Thanks in advance.

avatar richard67 richard67 - change - 18 Jun 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-06-18 14:09:26
Closed_By richard67
Labels Added: ?
Removed: ?
avatar richard67 richard67 - close - 18 Jun 2021
avatar richard67 richard67 - change - 18 Jun 2021
Labels Removed: ?
avatar richard67 richard67 - unlabeled - 18 Jun 2021

Add a Comment

Login with GitHub to post a comment