J4 Issue ?
avatar infograf768
infograf768
17 Jul 2018

Steps to reproduce the issue

Here on a multilingual site, but I guess same on a monolanguage site.
Create a multingual site with multilingual sample data.
Create a contact category tagged to a specific language.
Create a contact —without selecting a user— tagged to the same language in this category.
Create a contact category menu item to display the contact category tagged to the same language.

Click on the category menu item in frontend.

Actual result

"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"

Same issue for Newsfeeds category.

avatar infograf768 infograf768 - open - 17 Jul 2018
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jul 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Jul 2018
avatar infograf768
infograf768 - comment - 17 Jul 2018

Edit: the issue (for contacts) is specific to the List Contact in a Category Menu Item Type

avatar franz-wohlkoenig franz-wohlkoenig - change - 17 Jul 2018
Status New Discussion
avatar joomla-cms-bot joomla-cms-bot - edited - 17 Jul 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 17 Jul 2018
Category com_contact com_newsfeeds Multilanguage
avatar infograf768 infograf768 - change - 18 Jul 2018
Labels Added: J4 Issue
avatar infograf768 infograf768 - labeled - 18 Jul 2018
avatar infograf768
infograf768 - comment - 18 Jul 2018

Edit: The issue is only present on a multilingual site.

avatar infograf768 infograf768 - change - 18 Jul 2018
The description was changed
avatar infograf768 infograf768 - edited - 18 Jul 2018
avatar wilsonge
wilsonge - comment - 18 Jul 2018

This stems from this line https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_categories/helpers/association.php#L41 - we're importing the class through the Joomla Autoloader and then again additionally through the composer autoloader leading to class conflicts I believe

@mbabker @laoneo any good ideas?

avatar mbabker
mbabker - comment - 18 Jul 2018

OK, this is nitpicking, but the error path has an all lowercase path. In 4.0 it should be /components/com_contact/Helper/Route.php (note the 2 uppercase characters). So, does your checkout have both /components/com_contact/Helper/Route.php (correct with uppercase) AND /components/com_contact/helper/route.php (3.x with lowercase)?

This stems from this line https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_categories/helpers/association.php#L41 - we're importing the class through the Joomla Autoloader and then again additionally through the composer autoloader leading to class conflicts I believe

On a case sensitive filesystem that really shouldn't be doing anything at all. If it is, we've got bigger problems.

avatar wilsonge
wilsonge - comment - 18 Jul 2018

On a case sensitive filesystem that really shouldn't be doing anything at all. If it is, we've got bigger problems.

Commenting out that line definitely solves the issue for me. Given having done a git blame that line is 6 years old. Are we sure that isn't just a typo and that it should have been helpers anyhow?

avatar wilsonge
wilsonge - comment - 18 Jul 2018

@bembelimen given you added this 6 years ago can you remember what it is for :P c093329#diff-6f7be9c393def360d4bcf5bdbfcca15dR43

avatar mbabker
mbabker - comment - 18 Jul 2018

helper is a special case in JLoader::import(). So it's right for that part of things, though I don't think that line could've ever worked right to load something from the helpers directory.

avatar infograf768
infograf768 - comment - 19 Jul 2018

Commenting out that line definitely solves the issue for me.

Indeed. Tested also in 3.x and it does not have here any side effect with core components.

avatar infograf768
infograf768 - comment - 19 Jul 2018

Even with this change (in 4.0), router behaves weirdly:
I have for the menu item
/index.php/en/contact-category-en-gb // now works fine
For the link on that page displaying the contact
/index.php/en/contact-category-en-gb/mycontact // see below direct menu item. this url is a double with the one below. Alias of that single contact is mycontact
// I do also have a direct menu item to that contact alias of the menu item is my_contact
When I use this last one (/index.php/en/my-contact), the category link above the contact gives
/index.php/en/my-contact?view=category&id=14 instead of the existing /index.php/en/contact-category-en-gb

avatar wilsonge
wilsonge - comment - 20 Jul 2018

OK I'll play safe and just remove the line from 4.x - given I don't understand it's purpose completely i'm nervy about removing it from 3.x

avatar wilsonge
wilsonge - comment - 20 Jul 2018

Removed with 0af0077

avatar wilsonge wilsonge - change - 20 Jul 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-07-20 13:04:00
Closed_By wilsonge
avatar wilsonge
wilsonge - comment - 20 Jul 2018

@infograf768 I've reproduced your issue with contacts and can confirm it. Can we open that as a fresh issue please as it's not strictly related to the fatal? Thanks!

avatar wilsonge wilsonge - close - 20 Jul 2018
avatar infograf768
infograf768 - comment - 20 Jul 2018

OK

avatar infograf768
infograf768 - comment - 20 Jul 2018

Done #21200

Add a Comment

Login with GitHub to post a comment