Language Change PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
27 Jan 2025

Pull Request for Issue #42376 , #38835 .
redo of #42765 for sql custom field

Summary of Changes

add a new plugin to allow the user to set max render and max result for content category fancy list:

issue 42376 - Backend : Articles ->Category-Filter
issue 38835 - New Article - Select Category
- Category List filter
pr 42765 - allow to set max render and max result for fancy list on custom sql field

Testing Instructions

  • create more than 10 content category with same prefix something like
    image

  • apply the pr ,discover the new plugin or use the prebuild package

  • enable the plugin and set max render more than 10

Actual result BEFORE applying this Pull Request

you cannot see more than 10 result
fancycat

Expected result AFTER applying this Pull Request

you can set how many result to render

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

avatar alikon alikon - open - 27 Jan 2025
avatar alikon alikon - change - 27 Jan 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jan 2025
Category Unit Tests Repository Administration com_admin SQL Postgresql com_associations com_banners
avatar alikon alikon - change - 4 Feb 2025
Labels Added: Unit/System Tests PR-5.2-dev
avatar joomla-cms-bot joomla-cms-bot - change - 4 Feb 2025
Category Unit Tests Repository Administration com_admin SQL Postgresql com_associations com_banners Administration com_fields Language & Strings Front End Plugins
avatar alikon alikon - change - 4 Feb 2025
Labels Added: Language Change PR-5.3-dev
Removed: Unit/System Tests
avatar joomla-cms-bot joomla-cms-bot - change - 4 Feb 2025
Category Administration com_fields Language & Strings Front End Plugins SQL Administration com_admin Postgresql com_categories com_fields Language & Strings Installation Libraries Front End Plugins
6082468 4 Feb 2025 avatar alikon cs
9bd98ff 4 Feb 2025 avatar alikon cs2
avatar alikon alikon - change - 5 Feb 2025
Labels Removed: PR-5.2-dev
4efb5b5 10 Feb 2025 avatar alikon lang
avatar alikon alikon - change - 10 Feb 2025
Title
redo of #42765
[5.3] set max results for content category fancy select
avatar alikon alikon - edited - 10 Feb 2025
avatar alikon alikon - change - 10 Feb 2025
The description was changed
avatar alikon alikon - edited - 10 Feb 2025
avatar fgsw
fgsw - comment - 11 Feb 2025

@alikon

  • Is it expected that the plugin works only in the Articles-List-View? In the Categories-List-View is the same behaviour as without the Pull Request.
  • Changing in the plugin Max Results change the showing Results, but how to test Max Render?
avatar alikon
alikon - comment - 11 Feb 2025

the plugin as it is for now works only on Articles List View and on New Articles i'll check for the category list later

the max render can be tested setting for example 5 in the plugin settings and check that are rendered only 5 category items not all as before

avatar joomdonation
joomdonation - comment - 11 Feb 2025

I think it does not make sense to introduce a system plugin to allow changing the attributes of these fields. If changed are needed, add these attributes directly to the field definition instead.

avatar fgsw fgsw - test_item - 11 Feb 2025 - Tested successfully
avatar fgsw
fgsw - comment - 11 Feb 2025

I have tested this item ✅ successfully on 06ae85a


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

avatar alikon
alikon - comment - 11 Feb 2025

I think it does not make sense to introduce a system plugin to allow changing the attributes of these fields. If changed are needed, add these attributes directly to the field definition instead.

should be more easy for an end user to change the settings in this way imho

avatar joomdonation
joomdonation - comment - 11 Feb 2025

Having a system plugin for this like this is expensive. I think we need to figure out what would be the best default value for these attributes, and adjust the fields to use it.

A plugin like this, should not be part of the core. If it is needed, it should be a third party plugin.

avatar Fedik
Fedik - comment - 11 Feb 2025

I agree with @joomdonation use of the plugin for this is overkill, it fine in personal project, but not for core.

However if you think that 10 is not enough, you can just add data-max-results="20" (or any other amount, that you think is sufficient) in all core category filters .

That would make more sense

avatar alikon
alikon - comment - 11 Feb 2025

i can convert this as a third party plugin, what about custom sql fields ?
@fgsw i've added the category list filter too

p.s.
btw
i've done this way after a JBS meeting

avatar alikon alikon - change - 11 Feb 2025
The description was changed
avatar alikon alikon - edited - 11 Feb 2025
avatar joomdonation
joomdonation - comment - 11 Feb 2025

I do not know the internal of that script, but I think we have to choices here :

Option 1: Adjust the default value for these attributes in the script (for example, 20) so that it is used for all. Then we are done.

Option 2: Find all the fields which need this adjustment, then add data-max-results="20" to these fields. And in that case, the changes you did in the field plugins could be kept

@Fedik Do you have any idea about it? Would love to have your feedback here so that we can have the issues sorted.

avatar fgsw
fgsw - comment - 11 Feb 2025

@alikon Thanks for the Category list filter. I will test if the Pull Request can make it in the core.

avatar Fedik
Fedik - comment - 11 Feb 2025

@joomdonation the default values are set here

searchResultLimit: parseInt(this.select.dataset.maxResults, 10) || 10,
renderChoiceLimit: parseInt(this.select.dataset.maxRender, 10) || -1,

I am fine with any: can be changed the default value, so it will be applied globally, or can be edited the attribute in each field xml where it is need.

avatar joomdonation
joomdonation - comment - 11 Feb 2025

In this case, I would go with the global approach. Then later, if people needs more flexible options, we can add the attributes to each field need it and introduce settings to field plugins later.

@alikon Could you please change default value as @Fedik suggested? Note that I do not know what would be the right default value as I did not follow the issues from the beginning. Ping @angieradtke for suggestion if needed.

avatar brianteeman
brianteeman - comment - 11 Feb 2025

The problem as reported by @angieradtke is that there will never be a default value that can satisfy every use case

avatar alikon
alikon - comment - 11 Feb 2025

in that way you are always hard-coding a default value, that can be good or not depending on use case, and hard for an end user to suite their needs in an easy way, anyway.... i'll respect the final decision and in case i'll convert it as a non core plugin

avatar joomdonation
joomdonation - comment - 11 Feb 2025

The problem as reported by @angieradtke is that there will never be a default value that can satisfy every use case

Even if we add these attributes to the fields, we still face the same issue. We can only use a best default value. Then for people need to adjust it, they can use the third party plugin. Or maybe just implement an override to the layout ?

avatar Fedik
Fedik - comment - 11 Feb 2025

I think around 20-30 should be good enough.
I do not thinks that anything bigger than 50 makes sense.

maxRender should stay -1, as it is for "no limit" https://github.com/Choices-js/Choices?tab=readme-ov-file#renderchoicelimit

hmhm, or maybe set maxResults to no limit also, with -1

avatar brianteeman
brianteeman - comment - 11 Feb 2025

Why does it need a plugin - can it not simply be a value that you define in the component options

avatar joomdonation
joomdonation - comment - 11 Feb 2025

Why does it need a plugin - can it not simply be a value that you define in the component options

I assume you want to add it to options of categories component, that would only solve the issues for categories field, not other fields which use fancy select layout. And I don't know if it is really needed to have the option.

avatar brianteeman
brianteeman - comment - 11 Feb 2025

I dont see the need either. Its a very edge case that @angieradtke had

avatar alikon
alikon - comment - 11 Feb 2025

more i look at this more i think it should be as much more simple, as @Fedik already suggested just set a default for searchResultLimit: parseInt(this.select.dataset.maxResults, 50) || 50,

should be more than enough even for edge cases (50)

sorry for the noise and thank you all for the brain-storming

avatar alikon alikon - change - 11 Feb 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-02-11 11:59:06
Closed_By alikon
avatar alikon alikon - close - 11 Feb 2025
avatar alikon
alikon - comment - 11 Feb 2025

please check #44856

Add a Comment

Login with GitHub to post a comment