? Pending

User tests: Successful: Unsuccessful:

avatar roland-d
roland-d
2 May 2022

Summary of Changes

While building a multi-lingual site with tags we found out that the mod_tags_popular module was not producing SEF URLs due to missing the language string. When the menu items had their language set to All (*) it worked fine but when changing them to English (en-GB) and Dutch (nl-NL) the links are no longer working. After some investigation I found out that the Tags RouteHelper does not take the current language into account. This fix resolves that.

Testing Instructions

  1. Create a Joomla site with 2 languages (here I assume EN and NL)
  2. Create some Tags associated with the English language
  3. Create some Tags associated with the Dutch language
  4. Create some Articles associated with the English language and select some English Tags
  5. Create some Articles associated with the Dutch language and select some Dutch Tags
  6. In the English Home menu create a menu entry of the type List All Tags and set the language to English
  7. In the English Home menu create a menu entry of the type Compact List of Tagged Items and set the language to English, select a tag used by the English articles and set Content Type to Articles
  8. In the Dutch Home menu create a menu entry of the type List All Tags and set the language to Dutch
  9. In the Dutch Home menu create a menu entry of the type Compact List of Tagged Items and set the language to Dutch, select a tag used by the Dutch articles and set Content Type to Articles
  10. Create a front-end module of the type Tags Popular and set the language to English and assign it to a menu item that is set in step 7
  11. Create a front-end module of the type Tags Popular and set the language to Dutch and assign it to a menu item that is set in step 9
  12. Go the URL that links to the menu item created in step 7
  13. Click on an article shown there
  14. You should see the module from step 10 on this page
  15. Notice that the links in the module are not as expected but they contain component/tags/tag
  16. Go the URL that links to the menu item created in step 9
  17. Click on an article shown there
  18. You should see the module from step 11 on this page
  19. Notice that the links in the module are not as expected but they contain component/tags/tag
  20. Apply the patch
  21. Redo step 12 - 14
  22. You should see the correct URL in the module
  23. Redo step 16 - 18
  24. You should see the correct URL in the module

Actual result BEFORE applying this Pull Request

The URLs in the module do not show the correct SEF URL but instead contain component/tags/tag

Expected result AFTER applying this Pull Request

The URLs in the module do show the correct SEF URL according to their menu item

Documentation Changes Required

None

avatar roland-d roland-d - open - 2 May 2022
avatar roland-d roland-d - change - 2 May 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2022
Category com_tags Front End Layout Libraries Modules Plugins
avatar roland-d roland-d - change - 2 May 2022
Title
Make the RouteHelper language aware
Make the Tags RouteHelper language aware
avatar roland-d roland-d - edited - 2 May 2022
avatar wilsonge
wilsonge - comment - 3 May 2022

LGTM overall.

In terms of the b/c. what's the change of * compared to the query not existing before (i.e. if people in the JLayout don't update their template override is there a behaviour change?)

avatar roland-d
roland-d - comment - 3 May 2022

@wilsonge There is no b/c break here because the default value mimics the old behavior. So by not specifying the language the function works like it currently does.

avatar roland-d roland-d - change - 3 May 2022
The description was changed
avatar roland-d roland-d - edited - 3 May 2022
avatar Quy
Quy - comment - 5 May 2022

Fixes #31530 #31754 ?

avatar roland-d
roland-d - comment - 5 May 2022

It sounds like it, they should test this

avatar roland-d roland-d - change - 14 May 2022
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 24 May 2022
Category com_tags Front End Layout Libraries Modules Plugins com_tags Front End Layout Modules Plugins
avatar joomdonation
joomdonation - comment - 25 May 2022

@roland-d I spent sometime to test this PR today and it works good for me. The only thing left is that in RouteHelper class, we have getTagsRoute() method, I think we should add support for $language parameter, too. Could you please look at it? This method is not used in the core, but I think the code should be consistent. After that, I can mark my test success for the PR. Thanks.

avatar roland-d
roland-d - comment - 26 May 2022

@joomdonation I have added the language as option to the getTagsRoute() as well. I did not look at it before as I am not using it either :)

avatar joomdonation joomdonation - test_item - 26 May 2022 - Tested successfully
avatar joomdonation
joomdonation - comment - 26 May 2022

I have tested this item successfully on 4f446c2


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

avatar joomdonation
joomdonation - comment - 26 May 2022

All good now, thanks @roland-d

avatar hakanara
hakanara - comment - 27 May 2022

I had the same issue for a very long time. I would like to thank to all the contributors. I have a question: Would this fix be affecting Joomla 3.10 as well in the upcoming release? Or only the 4.1?

avatar chmst chmst - test_item - 27 May 2022 - Tested successfully
avatar chmst
chmst - comment - 27 May 2022

I have tested this item successfully on 4f446c2


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

avatar Quy Quy - change - 27 May 2022
Status Pending Ready to Commit
avatar Quy
Quy - comment - 27 May 2022

RTC


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

avatar Quy Quy - change - 28 May 2022
Labels Added: ?
avatar bembelimen
bembelimen - comment - 5 Jun 2022

@wilsonge There is no b/c break here because the default value mimics the old behavior. So by not specifying the language the function works like it currently does.

In 8.1 this breaks. No fix for a bugfix release. In my opinion something for 5.0 because of 8.1 (see: https://onlinephp.io/c/e5394), but moving to 4.2 so you can decide.

avatar roland-d roland-d - change - 6 Jun 2022
Labels Added: ?
Removed: ?
avatar hakanara
hakanara - comment - 8 Jun 2022

I would like to ask one more time, will this fix be applied to 3.10 as well?

avatar laoneo
laoneo - comment - 9 Jun 2022

If possible, then the deprecated function should call the new function and not have duplicated code.

avatar roland-d
roland-d - comment - 9 Jun 2022

@laoneo Of course, good point. Code cleaned up.

avatar joomdonation
joomdonation - comment - 9 Jun 2022

So the change is now backward-compatible. Do you want to have it in 4.1 @bembelimen ? Or should we re-test it for 4.2?

avatar laoneo laoneo - change - 10 Jun 2022
Status Ready to Commit Pending
avatar laoneo
laoneo - comment - 10 Jun 2022

Back to pending as some code got changed.


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

avatar roland-d roland-d - change - 12 Jun 2022
Labels Removed: ?
avatar joomdonation joomdonation - test_item - 12 Jun 2022 - Tested successfully
avatar joomdonation
joomdonation - comment - 12 Jun 2022

I have tested this item successfully on 762ae51

Works great now, thanks !


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

avatar richard67 richard67 - alter_testresult - 12 Jun 2022 - joomdonation: Tested successfully
avatar joomdonation
joomdonation - comment - 19 Jun 2022

@chmst Could you please re-test ? It's nice to have this issue fixed.

avatar viocassel viocassel - test_item - 20 Jun 2022 - Tested successfully
avatar viocassel
viocassel - comment - 20 Jun 2022

I have tested this item successfully on 7891e0e

?


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

avatar hakanara
hakanara - comment - 20 Jun 2022

I have opened this same issue 1,5 years ago. I am still looking forward to a solution for this since then. But I have to use Joomla 3.10 for one more year for some specific reasons. Please create an update for Joomla 3.10 as well since you already know how to modify the code. Thank you for everyone who have contributed for the solution.

avatar wilsonge wilsonge - close - 20 Jun 2022
avatar wilsonge wilsonge - merge - 20 Jun 2022
avatar wilsonge
wilsonge - comment - 20 Jun 2022

Two good tests. Let's get this in. Thankyou!

avatar wilsonge wilsonge - change - 20 Jun 2022
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-06-20 20:58:21
Closed_By wilsonge
avatar simbus82
simbus82 - comment - 5 Aug 2022

No one who answered @hakanara.
Multilanguage tags URL routing in Joomla 3.10 is broken like hell.
#31530

Remember that Joomla 3.x today is the 75% of all Joomla installed.
image

Is there a possibility that it can be solved on Joomla 3.10?
Can these changes be adapted?

avatar hakanara
hakanara - comment - 5 Aug 2022

Please hear us and create a solution for Joomla 3.10. Thank you for mentioning this @simbus82
I have opened this issue #31530 1,5 years ago when there was no Joomla 4.

Add a Comment

Login with GitHub to post a comment