-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Prefill tags with most used items #31481
Conversation
So looks like this blocker was intended. The remoteSearch option seems to have been added as part of the move to the choices.js element #22263 - first of all I guess it's worth asking whether we should roll back some of that code rather than adding in additional queries I definitely don't see the need to allow people to select the number of items returned? This seems like our favourite parameter creep Finally I think reducing the min term length should be done outside the scope of this PR. There's no need to really change that as part of this change Good work at figuring out this one though! |
@wilsonge I updated the PR by reverting the default min length and removed the limit parameter |
catch (\RuntimeException $e) | ||
|
||
// Only execute the query if we need more tags not already loaded by the $preQuery query | ||
if (!$isRemoteSearch || $prefillLimit > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this code always going to run because $prefillLimit
is set to 30 (and even in the previous version of your code if this was a parameter unless that param had been set to 0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$prefiilLimit
is set in line 244
I have tested this item ✅ successfully on aea7162 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31481. |
I have tested this item ✅ successfully on aea7162 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31481. |
Finally tested this and it's completely fine. Thanks! |
Pull Request for Issue #31348 .
Summary of Changes
Pre-fill the tags field with (default) 30 items based on the most used count.
Also reduce the min term length to 1, if there is a performance issue the site owner has to tweak this value.
Testing Instructions
Actual result BEFORE applying this Pull Request
The tags field was empty
Expected result AFTER applying this Pull Request
You have some (hopefully) tags to select.
Documentation Changes Required
N/A
Thanks to @bembelimen for helping