Feature Unit/System Tests Language Change PR-6.3-dev Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
2 Nov 2022

Pull Request for Issue #6687 .

Summary of Changes

Tags in Joomla so far had only partial support for multilanguage and contained partial, non-working code for associations. This PR adds associations completely, cleans up the code around them and brings the multilanguage behaviour of com_tags up to par with the rest of the Joomla core components.

Associations

  • The tag edit form has an "Associations" tab when multilanguage with item associations is enabled. It offers one field per content language, which only lists tags of that language.
  • Associations are stored in #__associations with the context com_tags.tag while saving a tag. The rest of TagModel::save() (nested set handling, path rebuild, events) is unchanged.
  • The backend tags list has an "Association" column with a badge for every associated tag, linking to its edit form.
  • com_tags now registers an association extension, so tags are available in the Multilingual Associations component (item type "Tags"), including the side-by-side editor.
  • In the frontend the language switcher redirects a tag view to the associated tag. A menu item can have more than one tag selected. In that case the association is looked up for each tag individually and the URL is built from all associated IDs combined. If one of the tags doesn't have an associated tag, the original tag is used, assuming that such a tag has * as its language.

Multilanguage

  • The tag_list_language_filter option was removed from the component options and the tag menu item types, because it conflicts with how multilinguality works in the rest of Joomla. When multilanguage is enabled, com_tags now behaves like the other components:
    • the tag and tags views only show tags and content items of the current language and *,
    • the "Popular Tags" and "Similar Tags" modules only show tags of the current language and *,
    • the tag field in frontend forms only offers tags of the current language and *,
    • a com_content category list filtered by tag only offers tags of the current language.
  • The router only reuses the active com_tags menu item when it matches the requested language, and RouteHelper::getComponentTagRoute() accepts an array of tag IDs and adds the language to the URL when multilanguage is enabled.

Tests

  • New Cypress system tests in tests/System/integration/administrator/components/com_tags/TagAssociations.cy.js cover the associations tab, creating, preselecting and removing associations, the list column and the Multilingual Associations component.
  • The system test DB cleanup now supports tables whose primary key is not id (#__languages), and there is a new db_createLanguage command.

Testing Instructions

1. General tag functionality (monolingual site)

  • Create a few tags in the backend in Components > Tags, including nested tags, and edit and move them. Check that the tree in the list stays correct.
  • Create new tags directly from the tag field of an article (type a new name and press Enter) and save the article.
  • Assign tags to articles, contacts and categories.
  • Create a "Tags > Tagged Items" menu item with one tag, one with several tags, and a "Tags > List of All Tags" menu item. Check in the frontend that they show the correct items, that pagination works and that the URLs are correct.
  • Publish the "Popular Tags" and "Similar Tags" modules and check that they still work.
  • Check that the option "Language Filter" is gone from the tags component options and from the tag menu item types.

2. Set up a multilingual site
The fastest way is to install a second language (e.g. German via System > Install Languages) and then use the "Multilingual Sample Data" from the Home Dashboard. Otherwise:

  • Install a second language and publish a content language for it in System > Content Languages.
  • Enable the "System - Language Filter" plugin with "Item Associations" set to Yes, and the "Content - Language Code" plugin if you want.
  • Create a home menu item for each language and publish a "Language Switcher" module.

3. Associations in the backend

  • Create a tag "Tag EN" with language English and a tag "Tag DE" with language German.
  • Edit "Tag EN" and open the "Associations" tab. There is a field for German which only lists German tags. Select "Tag DE" and save.
  • Edit "Tag DE": the association to "Tag EN" is preselected.
  • The tags list shows an "Association" column. Both tags have a badge linking to the other tag.
  • Go to Multilingual Associations, select the item type "Tags" and the language English. "Tag EN" is listed with its German association. Open the side-by-side editor and check that both tags load and that you can save them. Also create a new association for a tag without one from there.
  • Remove the association again in the tag form (clear the German field and save). The badges in the list disappear and the association is gone in Multilingual Associations as well.
  • Disable the "System - Language Filter" plugin: the "Associations" tab and the "Association" column are gone.

4. Multilingual frontend

  • Tag English articles with "Tag EN" and German articles with "Tag DE", and tag a few articles with language "All" with both.
  • Create a "Tags > Tagged Items" menu item for "Tag EN" in the English menu and one for "Tag DE" in the German menu.
  • Open the English tag page: it only shows English and "All" articles. Click the German flag in the language switcher: you are redirected to the German tag page, which only shows German and "All" articles.
  • Repeat with a menu item with several tags selected, where only some of the tags have associations. Switching the language uses the associated tags where they exist and the original tags otherwise.
  • Check that "List of All Tags", the "Popular Tags" and "Similar Tags" modules and the tag field in the frontend article edit form only show tags of the current language and "All".
  • Create a category list menu item with "Filter Field" set to "Tag". The tag filter only offers tags of the current language.

5. Automated tests

  • npx cypress run --spec tests/System/integration/administrator/components/com_tags/TagAssociations.cy.js passes.

Actual result BEFORE applying this Pull Request

Tags can't be associated, and the "Language Filter" option of com_tags makes the tag views and modules behave differently from the rest of a multilingual site.

Expected result AFTER applying this Pull Request

Tags can be associated like articles, contacts or categories, and the tag views and modules follow the current language.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

The removal of the tag_list_language_filter option and the new associations need to be documented in the help screens for com_tags and the tag menu item types.

avatar Hackwar Hackwar - open - 2 Nov 2022
avatar Hackwar Hackwar - change - 2 Nov 2022
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Nov 2022
Category ⇒ com_tags Administration Language & Strings Front End Libraries
avatar Hackwar Hackwar - change - 3 Nov 2022
Labels Added: Language Change ?
avatar joomla-cms-bot joomla-cms-bot - change - 3 Nov 2022
Category com_tags Administration Language & Strings Front End Libraries ⇒ com_tags Administration Language & Strings Front End com_content Libraries Modules
avatar Hackwar Hackwar - change - 3 Nov 2022
The description was changed
avatar Hackwar Hackwar - edited - 3 Nov 2022
avatar jamfx
jamfx - comment - 3 Nov 2022

I have tested this item ? unsuccessfully on 0d7ed82

Ok, i tried the following and didn't succeed. The Test failed at least partly.
Steps I took.

  1. Joomla Default Installation with Multilanguage Sample Data
  2. Installed German and Greek languagepacks
  3. Opened Tags and Translated Millions to Millionen for Association.
  4. now set Millions to English and Millionen to German
  5. Opened "Millions"-Tag and clicked on Associations. Now I wanted to choose Millionen and typed in "Mill" but only the item IDs showed up. I could save the IDs successfully, but after reopening nothing was shown in Associations.

I stopped the test here.
Thanks for your work so far!


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

avatar jamfx jamfx - test_item - 3 Nov 2022 - Tested unsuccessfully
avatar Hackwar
Hackwar - comment - 9 Nov 2022

@jamfx I did some fixes. Please test this again.

avatar Hackwar Hackwar - change - 23 Mar 2023
Title
…
[4.3] Tags: Adding associations
[4.4] Tags: Adding associations
avatar Hackwar Hackwar - edited - 23 Mar 2023
avatar Hackwar Hackwar - change - 23 Mar 2023
Labels Added: ?
avatar laoneo
laoneo - comment - 28 Mar 2023

Thank you for your contribution, unfortunately the 4.4-dev branch doesn't get new features. When #40181 is merged this pr should be rebased to 5.0-dev. Thanks for understanding.

avatar Hackwar Hackwar - change - 28 Mar 2023
Title
…
[4.4] Tags: Adding associations
[5.0] Tags: Adding associations
avatar Hackwar Hackwar - edited - 28 Mar 2023
avatar Hackwar Hackwar - change - 28 Mar 2023
Labels Removed: ?
avatar Hackwar Hackwar - change - 28 Mar 2023
Labels Added: ?
avatar Hackwar
Hackwar - comment - 28 Mar 2023

Since I had to rebase this from 4.3 to 4.4 and now to 5.0, I first have to check all the changes here if they are still correct. Switching back to draft for now.

avatar Hackwar Hackwar - change - 18 Apr 2023
Status Pending ⇒ Closed
Closed_Date 0000-00-00 00:00:00 ⇒ 2023-04-18 12:06:34
Closed_By ⇒ Hackwar
Labels Added: ?
Removed: ?
avatar Hackwar Hackwar - close - 18 Apr 2023
avatar richard67
richard67 - comment - 18 Apr 2023

Why closed? Should we reopen the original issue?

avatar Hackwar Hackwar - change - 18 Apr 2023
Status Closed ⇒ New
Closed_Date 2023-04-18 12:06:34 ⇒
Closed_By Hackwar ⇒
avatar Hackwar Hackwar - change - 18 Apr 2023
Status New ⇒ Pending
avatar Hackwar Hackwar - reopen - 18 Apr 2023
avatar HLeithner
HLeithner - comment - 30 Sep 2023

This pull request has been automatically rebased to 5.1-dev.

avatar Hackwar Hackwar - change - 4 Jan 2024
Labels Added: Feature
Removed: ?
avatar Hackwar Hackwar - change - 3 Apr 2024
Title
…
[5.0] Tags: Adding associations
[5.2] Tags: Adding associations
avatar Hackwar Hackwar - edited - 3 Apr 2024
avatar Hackwar Hackwar - change - 3 Apr 2024
Labels Added: ?
avatar Hackwar Hackwar - change - 16 Jul 2024
Labels Added: ?
Removed: ? ?
avatar fgsw
fgsw - comment - 1 Aug 2024

After local installation of Full Package.zip tried installation of german and persian farsi, but Unable to detect manifest file.

avatar brianteeman
brianteeman - comment - 1 Aug 2024

After local installation of Full Package.zip tried installation of german and persian farsi, but Unable to detect manifest file.

thats a known issue when using a development package as there are no language packs available for that version. For testing you can download a language pack for 5,.1 directly and then use the extension installer https://downloads.joomla.org/language-packs

avatar fgsw fgsw - test_item - 2 Aug 2024 - Tested unsuccessfully
avatar fgsw
fgsw - comment - 2 Aug 2024

I have tested this item ? unsuccessfully on 418dfb1

  • no Multilingual Sample Data used
  • added Tags, no associations shown:
    1
  • open a tag show prefilled association:
    2
  • save tag without changes, now associations shown:
    3
  • open another tag show same prefilled association:
    4
  • save tag without changes show different associations:
    5

Note 1: There is no difference if the tag is saved

  • without changes
  • deleted the association per x
  • using another tag as association.

Note 2: Tags associations tab looks different to article associations tab (Select, Create buttons):
2a


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39140.
avatar HLeithner
HLeithner - comment - 2 Sep 2024

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 2 Sep 2024
Title
…
[5.2] Tags: Adding associations
[5.3] Tags: Adding associations
avatar HLeithner HLeithner - edited - 2 Sep 2024
avatar richard67 richard67 - change - 15 Sep 2024
Labels Added: ?
Removed: ?
avatar HLeithner
HLeithner - comment - 4 Mar 2025

This pull request has been automatically rebased to 6.0-dev.

avatar HLeithner HLeithner - change - 4 Mar 2025
Title
…
[5.3] Tags: Adding associations
[6.0] Tags: Adding associations
avatar HLeithner HLeithner - edited - 4 Mar 2025
avatar Hackwar Hackwar - change - 31 Mar 2025
Labels Added: PR-6.0-dev
Removed: ?
avatar exlemor exlemor - test_item - 7 Jun 2025 - Tested unsuccessfully
avatar exlemor
exlemor - comment - 7 Jun 2025

I have tested this item 🔴 unsuccessfully on 6662268

Same results as @fgsw back in 2024 with multi-lingual setup where setting up initial Tags language association works but you can't setup a 2nd or 3rd pair (when you try it changes the 1st pair association)

ALSO, if you try to go to Components --> Multilingual Associations and then view Associations filtered by Tags, the component crashes with:

An error has occurred.
500 Unknown column 'a.created_by' in 'SELECT' Unknown column 'a.created_by' in 'SELECT'
Return to Dashboard

and after that you can't get back into Multilingual Associations without seeing that crash message - only way around that is to delete all browser cache, cookies, LocalStorage etc for that site and then you can see the component again after re-logging in.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39140.
avatar Hackwar
Hackwar - comment - 11 Jun 2025

@fgsw @exlemor Thank you for testing this. I finally had time to look into this and fixed several issues. It should now be working correctly. Can you please test this again? Maybe we can still get this into 6.0...

avatar exlemor exlemor - test_item - 16 Jun 2025 - Tested successfully
avatar exlemor
exlemor - comment - 16 Jun 2025

I have tested this item ✅ successfully on d2f2894

I have re-tested this successfully.
(and the Components --> Multilingual Associations --> Tags works as expected and doesn't crash ;) )

Thanks @Hackwar!


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

avatar brianteeman
brianteeman - comment - 2 Aug 2025

Surely this will break all existing sites that have menu items for tags with language filters

avatar brianteeman brianteeman - test_item - 2 Aug 2025 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 2 Aug 2025

I have tested this item 🔴 unsuccessfully on d2f2894


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

avatar brianteeman
brianteeman - comment - 2 Aug 2025

I have re-tested this successfully. (and the Components --> Multilingual Associations --> Tags works as expected and doesn't crash ;) )

No it doesnt - see video

chrome_weI3qxd7Lv.mp4
avatar HLeithner
HLeithner - comment - 31 Aug 2025

This pull request has been automatically rebased to 6.1-dev.

avatar HLeithner HLeithner - change - 31 Aug 2025
Title
…
[6.0] Tags: Adding associations
[6.1] Tags: Adding associations
avatar HLeithner HLeithner - edited - 31 Aug 2025
avatar Hackwar Hackwar - change - 13 Jan 2026
Labels Added: PR-6.1-dev
avatar 4digitalworld
4digitalworld - comment - 14 Jan 2026

I hope this will finally be added in Joomla 6.1 along with associations for #46671 modules.

avatar github-actions[bot]
github-actions[bot] - comment - 28 Feb 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

avatar Hackwar Hackwar - change - 28 Feb 2026
Labels Added: Conflicting Files
avatar HLeithner
HLeithner - comment - 17 Mar 2026

This pull request has been automatically rebased to 6.2-dev.

avatar tecpromotion tecpromotion - change - 15 Apr 2026
Title
…
[6.1] Tags: Adding associations
[6.2] Tags: Adding associations
avatar tecpromotion tecpromotion - edited - 15 Apr 2026
avatar github-actions[bot]
github-actions[bot] - comment - 20 Jun 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

avatar Hackwar Hackwar - change - 7 Nov 2026
Labels Added: PR-6.2-dev
Removed: PR-6.0-dev PR-6.1-dev
avatar richard67 richard67 - change - 7 Nov 2026
Title
…
[6.2] Tags: Adding associations
[6.3] Tags: Adding associations
avatar richard67 richard67 - edited - 7 Nov 2026
avatar Hackwar Hackwar - change - 7 Nov 2026
Labels Added: PR-6.3-dev
Removed: Conflicting Files PR-6.2-dev
avatar joomla-cms-bot joomla-cms-bot - change - 7 Nov 2026
Category com_tags Administration Language & Strings Front End Libraries com_content Modules ⇒ com_tags Administration Language & Strings Front End com_content Libraries Modules JavaScript Unit Tests
avatar Hackwar Hackwar - change - 28 Nov 2026
The description was changed
Labels Added: Unit/System Tests
avatar Hackwar
Hackwar - comment - 28 Nov 2026

@exlemor and @brianteeman could you check this again? I fixed a series of bugs and I hope we can finally get this going...

avatar brianteeman
brianteeman - comment - 28 Nov 2026

I'm still concerned about the removal of tag_list_language_filter. This isn't just removing an option from the UI. Existing sites may rely on that setting, and changing its behaviour could alter what visitors see after upgrading. Also just removing the option prevents new menu items using that filter but it doesnt remove the filter from an existing menu item and now there is no way to remove it

avatar Hackwar
Hackwar - comment - 29 Nov 2026

I understand that, however my argumentation would be, that the option actually was a bug. I don't see a situation where tags should behave differently to all other content items in Joomla. Removing it is not difficult, simply open the menu item and save it again. I do agree however, that that is not really self-evident. Maybe we need to remove the option from everywhere and move this to 7.0? I wouldn't be happy about that, if we need to move this from 4.3 to 5.x to 6.x and now maybe even to 7.0... But whats another few months when it's already been 4 years...

avatar brianteeman
brianteeman - comment - 29 Nov 2026

self evident or not its a breaking change

avatar 4digitalworld
4digitalworld - comment - 30 Nov 2026

If users could see Irish articles using the tag on the Italian version of the website, that's not ok.

That's what language associations and a module for switching the website to another language are for, so this update fixes the bug that wasn't fixed when Joomla started using language associations and tags.

Add a Comment

Login with GitHub to post a comment