joomla-cms
joomla-cms copied to clipboard
[5.1] sql custom field - max results from xml
Pull Request for Issue # .
Summary of Changes
control max results and max render from fancy-select by xml
Testing Instructions
Create an SQL field.
Use a query that returns more than 10 values that share the same portion of text for "text," for example:
SELECT 1 AS value, 'month-January' AS text
UNION ALL
SELECT 2 AS value, 'month-February' AS text
UNION ALL
SELECT 3 AS value, 'month-March' AS text
UNION ALL
SELECT 4 AS value, 'month-April' AS text
UNION ALL
SELECT 5 AS value, 'month-May' AS text
UNION ALL
SELECT 6 AS value, 'month-June' AS text
UNION ALL
SELECT 7 AS value, 'month-July' AS text
UNION ALL
SELECT 8 AS value, 'month-August' AS text
UNION ALL
SELECT 9 AS value, 'month-September' AS text
UNION ALL
SELECT 10 AS value, 'month-October' AS text
UNION ALL
SELECT 11 AS value, 'month-November' AS text
UNION ALL
SELECT 12 AS value, 'month-December' AS text;
In the Form Layout set as a view "Enhanced Select".
Actual result BEFORE applying this Pull Request
When you try to search for "month" as a value in the field, you only display 10 results as per choice.js default
Expected result AFTER applying this Pull Request
When you try to search for "month" as a value in the field, the number of values returned is governed by the parameters in the Field -> General
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
why does max-render have JALL but maxresults only have J500
if i read correctly choice.js code there is no -1 for for max-results but i could be wrong
maybe so but both fields are the same type and layout
not sure to get your point but 500 max search results are far better than 10 or not ? ❓
I am just querying why we have different settings
I am just querying why we have different settings
The current JS setting (without the options) is:
- Max Result = 10
- Max Render = -1 (ALL)
Max Result does not support -1 (ALL) so it cannot be included in the list because it would not work. Taking -1 (ALL) out of the Max Render list would limit the number of elements to a maximum of 500, so it would be a loss of functionality. The only solution I see is to leave the 2 different lists.
Thank you for a logical answer
I have tested this item :white_check_mark: successfully on 760c0295eb010240ad957afc5787aa7aa06a539f
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
I have tested this item :white_check_mark: successfully on 760c0295eb010240ad957afc5787aa7aa06a539f
OK, it works.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
I have tested this item :white_check_mark: successfully on 760c0295eb010240ad957afc5787aa7aa06a539f
all right
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
I have tested this item :red_circle: unsuccessfully on 760c0295eb010240ad957afc5787aa7aa06a539f
Changing firefox to dark mode immediately changes to dark mode in Joomla as well. With or without this patch.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
I have tested this item 🔴 unsuccessfully on 760c029Changing firefox to dark mode immediately changes to dark mode in Joomla as well. With or without this patch.
@crimle Are you sure you posted your test result for the right pull request (PR)? I don't see how this PR here is related to dark mode. Please check and report back, and either alter your test result back to "not tested" or ask us to do so for you. Thanks in advance.
I have not tested this item.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
I wonder, why did you rename the field name? How do you take care about the "old" values, isn't this a B/C break then?
iirc i didn't want to touch com_fields to limit the impact surface of the pr
I wonder, why did you rename the field name? How do you take care about the "old" values, isn't this a B/C break then?
Leaving form_layout
and binding the 2 options to that tag does not work.
data-*
options are loaded only with layout
, this xml tag is also documented here, when the limit to fancy was introduced.
To make it work with form_layout
com_fields has to be rewritten, which was not intended to be the goal of this PR
Not ready
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
The PR is not finished. It can go in 5.x, if done properly there no b/c break.
Current XML modifications should be reverted. As we talked with @Razzo1987 And some more changes still need to be done.
I would add, that the changes should be done for list
field first, and then copyed to sql
field.
Because sql field extends the list field.
Hi @Fedik, the problem stems from the fact that to fix the bug and continue using form_layout
the change on com_fields should be made. If I understand correctly from @alikon he does not feel confident in touching that part. If you can give him support I am also confident that using form_layout
avoids b/c breaks.
i would like to make this happen for 5.x not 6.x, let's join together the effort then, the pr it's already open, better,
let's schedule a meet via mattermost on the weekend ? if you can
@alikon I made a PR to fix stuff https://github.com/alikon/joomla-cms/pull/49
thank you @Fedik
I have tested this item :white_check_mark: successfully on d736c8804bcd60ca12a9d66c5403d6ce8107afd9
Successfully tested with both List and SQL.
Tested with the example of the 12 months of the year and used the combinations:
- Max Results: 10, Max Render: ALL: He behaves as he always has
- Max Results: 100, Max Render: ALL: Show the 12 months by searching "month" (there are less than 100)
- Max Results: 5, Max Render: 5: Show only 5 months, also by searching "month"
- Max Results: 100, Max Render: 5: Show only 5 months, by search it show all the 12 months
Another test: if I set the fancy layout before applying the patch now it is retained. Thanks @Fedik
However, I propose to include j500 in the options. For some cases 100 options might be few and we cannot put a consideration for ALL. J500 is 5x the current maximum and seems to me a good compromise.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
However, I propose to include j500 in the options.
It will have a huge performance and usability issue, I think anything more than 20-30 is already to much.
I have tested this item :white_check_mark: successfully on cdc2480aee53b81ada80e00e25280450d5c024bb
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
However, I propose to include j500 in the options.
It will have a huge performance and usability issue, I think anything more than 20-30 is already to much.
I'll try to do a video, but I really don't think it changes much in terms of performance. I have a SQL field that extracts 1500+ records and the latency is related to the query not the limits imposed by the fancy-select
I have tested this item :white_check_mark: successfully on cdc2480aee53b81ada80e00e25280450d5c024bb
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42765.