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.
"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.
Labels |
Added:
?
|
Status | New | ⇒ | Discussion |
Category | ⇒ | com_contact com_newsfeeds Multilanguage |
Labels |
Added:
J4 Issue
|
Edit: The issue is only present on a multilingual site.
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
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.
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?
@bembelimen given you added this 6 years ago can you remember what it is for :P c093329#diff-6f7be9c393def360d4bcf5bdbfcca15dR43
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.
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.
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
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
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-20 13:04:00 |
Closed_By | ⇒ | wilsonge |
@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!
OK
Edit: the issue (for contacts) is specific to the
List Contact in a Category
Menu Item Type