? Pending

User tests: Successful: Unsuccessful:

avatar conseilgouz
conseilgouz
1 Oct 2022

No limit if tag form field mode is set to nested.

Summary of Changes

Whatever mode tag form field value, a limit to 30 elements is set in libraries/src/Form/Field/TagField.php (line 133) and isRemoteSearch is set to true : general parameter tag_field_ajax_mode is set to 1 as default value.

Testing Instructions

Create more than 30 tags
Create a Tags - Popular module
Set up its parameters

Actual result BEFORE applying this Pull Request

In tags - popular module, Parent Tag parameter only shows 30 tags.

Expected result AFTER applying this Pull Request

In tags - popular module, Parent Tag parameter list shows all available tags

avatar conseilgouz conseilgouz - open - 1 Oct 2022
avatar conseilgouz conseilgouz - change - 1 Oct 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Oct 2022
Category Libraries
avatar Fedik
Fedik - comment - 1 Oct 2022

Sorry it is a bad changes.
You do not need to load all tags, the field support "search while typing" when isRemoteSearch is enabled. So you can search your tag already (even when it not loaded in first 30 items).

avatar conseilgouz
conseilgouz - comment - 1 Oct 2022

I do need all tags to be displayed in my modules, so the user selects which ones are to be displayed.

It maybe not necessary in Popular tags module that I took as an example to show the issue.

isRemoteSearch is enabled and the limit to 30 is set even if you defined mode=nested in your xml. They depend from the general parameters and ignore what you defined in your module's xml file.

With both values (ajax and nested), you'll have the 30 tags limit which does not make sense.

When looking at documentation https://docs.joomla.org/Tag_form_field_type , i don't see any limit.

avatar conseilgouz
conseilgouz - comment - 1 Oct 2022

I agree that ajax input will look for not shown tags, but, you have to know available tags names to access these information.

Why display an uncomplete tags list ?

There's an issue about this in ajax mode : #38763

avatar Fedik
Fedik - comment - 1 Oct 2022

so the user selects which ones are to be displayed.

User already can do that: type for search.

It maybe fine to display all when you have a few tags, but when you have a couple hundreds, then removing the limit it is a bad idea.

It maybe not necessary in Popular tags module

It used everywhere: Article editing, Content filter, some content modules

With both values (ajax and nested), you'll have the 30 tags limit which does not make sense

It a limit of initial tag rendering, it basicaly show top most used tags on the site on initial rendering. But it not a limit for User.
As I already told, User can search needed tag with: typing for search

avatar Fedik
Fedik - comment - 1 Oct 2022

Why display an uncomplete tags list ?

Because we have autocomplete search. Why we should pull all tags on first load, and slow down rendering?

you have to know available tags names to access these information.

Well, if you try to type what you need, you will get a suggestions, or you will get nothing ;)

avatar conseilgouz
conseilgouz - comment - 1 Oct 2022

you have to know available tags names to access these information.

Well, if you try to type what you need, you will get a suggestions, or you will get nothing ;)

Do you remember all the tags names you created ? I don't (maybe I'm getting too old)

avatar conseilgouz
conseilgouz - comment - 1 Oct 2022

Did I misunderstand what to expect from "mode=nested" in xml ?

My choice is "nested" but it's ignored (same choice in mod_tags_popular.xml)

avatar Fedik
Fedik - comment - 1 Oct 2022

Do you remember all the tags names you created ? I don't (maybe I'm getting too old)

No one remamber that ;)
But if you want to enter "Potato", you will start enetring "potato", and will get (or not) a suggestions.
Displaing All does not solver this issue, you still have to search and check if you have it or not.

Btw, you can try to make a PR to make the limit configurable, I think that will be more appropriate. But I cannot guarantee that it will be accepted by others, just an alternative idea ;)

avatar Fedik
Fedik - comment - 1 Oct 2022

Did I misunderstand what to expect from "mode=nested" in xml ?

It just some kind of formating, how to display the options in the list

avatar conseilgouz
conseilgouz - comment - 1 Oct 2022

thank you for your explanations,

avatar conseilgouz conseilgouz - change - 1 Oct 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-10-01 12:40:10
Closed_By conseilgouz
Labels Added: ?
avatar conseilgouz conseilgouz - close - 1 Oct 2022
avatar conseilgouz
conseilgouz - comment - 2 Oct 2022

For information, I found an undocumented option to fix my issue : add remote-search="false" in xml for my tag field.

This overrides ajax general parameter, all my tags are displayed in nested mode (which is my choosen mode, in xml file ).

It becomes :
<field name="tags" type="tag" label="SSISO_TAGS" description="SSISO_TAGSDESC" mode="nested" multiple="true" custom="deny" remote-search="false"/>

Add a Comment

Login with GitHub to post a comment