bug PR-4.4-dev Pending
Referenced as Related to: # 42529

User tests: Successful: 2 RickR2H, viocassel Unsuccessful: 0

avatar ricardo1709
ricardo1709
26 Jan 2024

Summary of Changes

Fixes the mismatch when SEF is enabled or disabled for the menu type "Tagged Items".

Testing Instructions

  1. Create two tags in Components > Tags.
  2. Create three Articles in Content > Articles where:
    1. The first article has the first tag;
    2. The second article has the second tag;
    3. And a article has both tags.
  3. Create a menu item with the type "Tags > Tagged Items" and with both the tags selected.
  4. View the menu item in the front-end
  5. Click on the first article.
  6. Click on the (first) tag.

See issue #42529 for more info.

Actual result BEFORE applying this Pull Request

You will see articles from both first and second tag.

Expected result AFTER applying this Pull Request

You will see articles from only the first tag.

Related Issues

#42529

avatar ricardo1709 ricardo1709 - open - 26 Jan 2024
avatar ricardo1709 ricardo1709 - change - 26 Jan 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Jan 2024
Category com_tags Front End
avatar RickR2H RickR2H - test_item - 26 Jan 2024 - Tested successfully
avatar RickR2H
RickR2H - comment - 26 Jan 2024

I have tested this item ✅ successfully on c2424a6

Tags now work as expected


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

avatar oorzaak
oorzaak - comment - 26 Jan 2024

Hi,
Very happy to hear that you guys have been working on it.

However, when copying the changes in components/com_tags/src/Service/Router.php to my test/develop site it makes no difference.

Please notice that I updated my site to J.4.4.2 before copying / editing / testing the Router.php file, because J.4.4.2 is out there. While updating I noticed that the J.4.4.2 code of Router.php was exactly the same as the J.4.4.1 code.

After this test I updated a dev copy of my live site to J.4.4.2 and I edited Router.php on this site as well. On this site it did not make a difference either.

Yet I noticed something strange here: the original code of the Router.php on this site was different from the original Router.php on the site mentioned above. I could not find the code that should be replaced so I copied to this site the same edited file that I edited on the dev site. Which results in perfectly the same behavior, as far as I can see.

I can only assume that the difference is because I created the dev site using a fresh J.4.4.1 install while the live site was built using the latest J. version available at that moment, which was J.4.0.x. (and it was updated afterwards, with every J.4 update).

avatar RickR2H
RickR2H - comment - 26 Jan 2024

Best way to test is to do an install of: https://github.com/ricardo1709/joomla-cms/archive/tags-router-fix.zip
The link is also provided underneath the title.
If the tags work in that installation then we know it's working.


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

avatar oorzaak
oorzaak - comment - 26 Jan 2024

Hi Rick, and thx.

However, when I try to install this zip I get this message:

JInstaller: :Install: Can't find Joomla XML setup file.
The Joomla package cannot be installed through the Extension Manager. Please use the Joomla! Update component to update Joomla.

I also tried updating using the ur, which gave the same message.

And I checked if anything had changed despite this message, but the behavior is still the same as well.

Frits


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42716.
avatar RickR2H
RickR2H - comment - 26 Jan 2024

It's a full Joomla installation. You have to install the zip as a regular Joomla installation.
Or use the patchtester: https://docs.joomla.org/Component_Patchtester_for_Testers
It isn't that hard. Hope you'll manage!

avatar oorzaak
oorzaak - comment - 26 Jan 2024

Ok, thx. This is not daily business for me ;-)
I'll give it a try later on and I'll post my feedback here.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42716.
avatar viocassel viocassel - test_item - 27 Jan 2024 - Tested successfully
avatar viocassel
viocassel - comment - 27 Jan 2024

I have tested this item ✅ successfully on c2424a6


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

avatar RickR2H RickR2H - change - 27 Jan 2024
Status Pending Ready to Commit
avatar RickR2H
RickR2H - comment - 27 Jan 2024

RTC


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

avatar oorzaak
oorzaak - comment - 29 Jan 2024

Hi Rick,

I tested this fix successfully as well.

Thanks for your help,

Frits


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

avatar oorzaak
oorzaak - comment - 29 Jan 2024

Oh, just one more question. Would it be safe to install this patch (using the Patch Tester) on a live site?

I waited with updating the site for this issue to be solved, so I suppose that I need to update the Joomla install to J.4.4.2 first and then apply the patch?

Frits


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

avatar RickR2H
RickR2H - comment - 29 Jan 2024

@oorzaak Thanks for testing the patch. As you can see in the status is was already RTC (Ready to commit). This means that the team will look at the fix an probably will merge this patch. It's up to them if and when this patch will be merged. You could for now just add the changed code to your website as te temporary fix. But keep in mind, if the changes are not added in the next release, you have to add the changes again manually after a Joomla update.

For your information. When you log in on this site with your GitHub account, you can set the test on top on the site with a button. See: https://docs.joomla.org/Testing_Joomla!_patches

Also a good idea to ask some help on how to test patches at your local Joomla User Group.


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

avatar Hackwar
Hackwar - comment - 29 Jan 2024

I am very concerned that this will change the behavior of the tags component. Right now you can have any tags as segments at the end of the URL and this change would limit that to only those tags which are selected in the menu item. Since the tags component is pretty messed up, I would rather want to see a big change which refactors this than this change, which I fear breaks something.

avatar oorzaak
oorzaak - comment - 31 Jan 2024

@Hackwar, for my use case this seems not to be a problem. The menu items of the tagged items type are intented as a way of structuring the content of this site. The way I see it, there is no need to include tags that are not set in a menu item on that particular page. Or maybe I don't understand correctly what you mean?

And of course I understand that you want the component to handle different types of use cases.

avatar 1inkin
1inkin - comment - 1 Feb 2024

With issue #41179 this solution results in a 404 error


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

avatar oorzaak
oorzaak - comment - 1 Feb 2024

I cannot reproduce a 404 on my test site https://j441.oorzaak-develop.nl

On this site I have two menu items of the type Tagged items, one named "Health Care" with a selection of tags that includes "covid" and "mental health", the other named "Money", including the tag "taxes". Now I created a new tag "Different subject" and I did NOT include it in any of the menu items. I did however assign it to an article - only to this article, and I did not assign any other tags to the article.

Next, I created a Popular tags module. All tags mentioned above are displayed in this module. When clicking the tag Covid in this module, I am redirected to an url that is associated with one of the menu items: https://j441.oorzaak-develop.nl/healthcare/covid

When clicking the tag Different subject in the module, I am redirected to a component url: https://j441.oorzaak-develop.nl/component/tags/tag/different-subject

So we have a different behavior depending om weather the tag is selected in one of the menu items, but no 404.

avatar 1inkin
1inkin - comment - 1 Feb 2024

I think you didn't follow step 3 from #41179. the menu should have parameter Match Type = All


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

avatar 1inkin
1inkin - comment - 2 Feb 2024

I'm sorry. my mistake when changing the code. The solution works. But my site is still seeing weird tags behavior in some cases. I'm now trying to reproduce this on a test site


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

avatar 1inkin
1inkin - comment - 2 Feb 2024

If a tag is used in a menu item, and if you click on a tag in a article to open a list of all articles with this tag, then it will not open a list of articles for the tag, but a menu item with this tag will open


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

avatar 1inkin
1inkin - comment - 2 Feb 2024

@oorzaak
On your website. For example, when you click on a tag Mental Health, a menu item Healthcare is activated. this is not correct behavior


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

avatar oorzaak
oorzaak - comment - 5 Feb 2024

@1inkin Sorry for my late reply.
The behavior on my website is as expected, because I created 2 parent tags called Healthcare and Money. The tags Mental health and Covid are both child tags of Health Care. It is intended to see the menu item of the parent tag when viewing the items list of the child tag.
This may seem more complicated than necessary for a test setup. However, this reflects the structure of our live site where I ran into this issue. This is also described in the thread that I started: #42529

avatar 1inkin
1inkin - comment - 6 Feb 2024

@oorzaak
This misleads users in many cases. If user clicks on the Healthcare menu item, he receives only one article. If user clicks on the tag Mental Health, he receives three articles indicating Healthcare menu item. That is, in one menu user receives two different results. This is even more obvious when a menu item has a menu header that says that this menu selects multiple tags, then lists articles for a single tag. If tag is selected for several menu items, then when opening the list of articles for this tag, the first menu item that appears is selected as active.


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

avatar oorzaak
oorzaak - comment - 7 Feb 2024

@1inkin Thanks for pointing this out; that is my mistake. I experimented with the Item Selection Options of the menu items on this site and did not reset them to the original settings after that. The Match Type as it is on my live site is "Any", and the situation as you saw it was caused by the setting "All".

It is set to "Any" again now. That should make more sense.


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

avatar 1inkin
1inkin - comment - 7 Feb 2024

@oorzaak
Now it still produces different results - three articles when selecting a tag and four articles when selecting a menu item:). The main problem here is the behavior of the site when choosing a tag. when the user clicks on a tag, it should open a page with a list of articles for that tag. this page should not be linked to any menu item because the user selected a tag, not a menu item. this works correctly if you select a tag that is not linked to any menu item. On my site there are many different menu items with different variations of several tags, and when the user selects one of these tags, he is shown a menu page where modules associated with this menu item are also displayed. this is completely wrong and misleading. I think, need to create a new item for this issue...


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

avatar MacJoom
MacJoom - comment - 21 Feb 2024

Hi @ricardo1709 - thank you for the PR - can you answer to the discussion? I need some more for information

avatar MacJoom
MacJoom - comment - 21 Feb 2024

@tramber91 - Hi i know you have a big site using tags in menus - can you have a look at this PR? Thanks a lot

avatar Quy Quy - change - 28 Feb 2024
Status Ready to Commit Pending
avatar Quy Quy - change - 28 Feb 2024
Labels Added: bug PR-4.4-dev
avatar ricardo1709 ricardo1709 - change - 27 Mar 2024
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2024-03-27 19:25:45
Closed_By ricardo1709
avatar ricardo1709 ricardo1709 - close - 27 Mar 2024
avatar 1inkin
1inkin - comment - 29 May 2024

will this fix be added to the Joomla distribution? After each Joomla update, i have to manually make changes so that the tags work correctly

avatar RickR2H
RickR2H - comment - 29 May 2024

I guess not as this plugin is closed. Probably because of the comment that a more robust fix is needed and not a patch.

avatar 1inkin
1inkin - comment - 29 May 2024

@RickR2H Understood. but it seems that after this topic was closed, this problem was forgotten. i will have to continue to use this fix manually.

Add a Comment

Login with GitHub to post a comment