J4 Issue ?
avatar infograf768
infograf768
15 Jul 2018

Steps to reproduce the issue

Create a multilingual site with the multilingual sample data.
Make sure sef is on. Tested here with url rewriting
Load frontend home and switch language via the language switcher.

Expected result

We should get urls of type
whatever/fr
whatever/en

Actual result

We get
/en?view=category&id=8
and
/fr?view=category&id=9

Supplementary information.

When homes are single article or when homes are single contacts, the urls are correct.
This may come from #20692

@laoneo

Note:

Could not test with a contact category as I have
Fatal error: Cannot declare class Joomla\Component\Contact\Site\Helper\Route, because the name is already in use in /Applications/MAMP/htdocs/installmulti/joomla40/components/com_contact/helper/route.php on line 24

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar infograf768 infograf768 - open - 15 Jul 2018
avatar joomla-cms-bot joomla-cms-bot - change - 15 Jul 2018
Labels Added: J4 Issue ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Jul 2018
avatar infograf768 infograf768 - change - 15 Jul 2018
The description was changed
avatar infograf768 infograf768 - edited - 15 Jul 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Jul 2018
Status New Confirmed
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Jul 2018

Issue confirmed.


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Jul 2018
Category Router / SEF
avatar laoneo
laoneo - comment - 15 Jul 2018

@infograf768 when you revert #20692, does it work correctly then?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Jul 2018

@infograf768 is this new Error connect with this Issue or should i open a new Issue?
Error gone by Reload.

avatar infograf768
infograf768 - comment - 16 Jul 2018

Error gone by Reload.

What do you mean?

@laoneo

@infograf768 when you revert #20692, does it work correctly then?

Concerning the home being a category, yes, it works fine. I now get via the switcher or from home menu item
whatever/fr
whatever/en

For articles as home (with OR without #20692 )
If I use the switcher I do get
whatever/fr
whatever/en
as well when using another specific menu item displaying the same article

Without #20692 , If the article menu items are associated OR the articles concerned are associated AND they are not home (home is category), then when displaying an article via its menu item, when switching language the switcher directs to the home page with a link of type
whatever/en

With #20692 If the article menu items are associated OR the articles concerned are associated AND they are not home
The switcher flag for the language in use gives correctly
/en/modules-en-gb
but when switching to the other language, we get
`/fr?view=article&id=13&catid=12

EDIT: in this last case, it is interesting to Note that the "Also Available" link in the infoblock IS correct.
I mean the link from the flag here:
screen shot 2018-07-16 at 10 26 43

For single contact, no problem.

For contacts categories I have the same Fatal error (it is unrelated)

avatar laoneo
laoneo - comment - 16 Jul 2018

but when switching to the other language, we get /fr?view=article&id=13&catid=12

So this is the only thing which does not work correct since #20692?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Jul 2018

Error gone by Reload.

What do you mean?

@infograf768 Was a Browser-Cache-Issue.

avatar infograf768
infograf768 - comment - 16 Jul 2018

I mean which error was?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Jul 2018

Screenshot deleted, can't say what the Error-message was.

avatar infograf768
infograf768 - comment - 16 Jul 2018

Ok, understand now.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Jul 2018

As far as i remeber got a 404, after reload of Page it works.

avatar infograf768
infograf768 - comment - 16 Jul 2018

So this is the only thing which does not work correct since #20692?

No. remains the original issue when category is home

Actual result

We get
/en?view=category&id=8
and
/fr?view=category&id=9

But I think I found the issue in the language switcher WHEN using #20692. Solution works for category and article!

Can you solve in the mean while the Fatal error for contact and newsfeed?
Could not test with a contact category as I have
Fatal error: Cannot declare class Joomla\Component\Contact\Site\Helper\Route, because the name is already in use in /Applications/MAMP/htdocs/installmulti/joomla40/components/com_contact/helper/route.php on line 24

And cannot define associations for a single contact in core.

The reason is that the code which solves the issue FOR articles and articles category in the switcher is a change in

if (isset($cassociations[$language->lang_code]))
					{
						$language->link = Route::_($cassociations[$language->lang_code] . '&lang=' . $language->sef);

If I change to

$language->link = Route::_($cassociations[$language->lang_code]);

Then all is OK.

Will it work for contact and newsfeeds is the matter.
If it does not (which I think is possible and I can't test without solving the specific errors for these components), then it means we have to add a conditional to deal with components which are not instanceof AssociationServiceInterface

avatar infograf768
infograf768 - comment - 16 Jul 2018

Forgot to say that this works only perfectly when sef is on. When off we can get for homes a very long url or a simple one of type index.php?lang=en

avatar infograf768
infograf768 - comment - 16 Jul 2018

OK. This modif does work for single newsfeed, after I corrected a wrong call to FeedFactory.
will make patch.

avatar infograf768 infograf768 - change - 16 Jul 2018
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2018-07-16 10:59:36
Closed_By infograf768
avatar infograf768
infograf768 - comment - 16 Jul 2018

as we have #21141 closing

avatar infograf768 infograf768 - close - 16 Jul 2018

Add a Comment

Login with GitHub to post a comment