[Rt-commit] rt branch, 4.4/dropdown-menu-limit-config, created. rt-4.4.2-65-g7b3dc18d5

Maureen Mirville maureen at bestpractical.com
Thu Jan 25 14:24:28 EST 2018


The branch, 4.4/dropdown-menu-limit-config has been created
        at  7b3dc18d5801dcb80f27da494410ef8d7278faf8 (commit)

- Log -----------------------------------------------------------------
commit 7b3dc18d5801dcb80f27da494410ef8d7278faf8
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date:   Tue Jan 23 14:03:58 2018 -0500

    Make RT owner dropdown limit a config option
    
    The Owner dropdown menu, used in various places in RT, automatically
    changes from a dropdown menu to an autocomplete field once there are
    greater than 50 values. As some users may want to change this limit,
    a new config option was added so it can easily be updated, rather
    than using a callback. Existing callbacks on this limit will continue
    to work as expected.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 48fd0fe52..4ef8f0979 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1575,8 +1575,11 @@ builder are replaced by text fields that autocomplete.  This can
 alleviate the sometimes huge owner list for installations where many
 users have the OwnTicket right.
 
-Autocompleter is automatically turned on if list contains more than
-50 users, but penalty of executing potentially slow query is still paid.
+The Owner entry is automatically converted to an autocomplete box if the list
+of owners exceeds C<$DropdownMenuLimit> items. However, the query to generate
+the list of owners is still run and this can increase page load times. If
+your owner lists exceed the limit and you are using the autocomplete box, you
+can improve performance by explicitly setting C<$AutocompleteOwners>.
 
 Drop down doesn't show unprivileged users. If your setup allows unprivileged
 to own ticket then you have to enable autocompleting.
@@ -1585,6 +1588,22 @@ to own ticket then you have to enable autocompleting.
 
 Set($AutocompleteOwners, 0);
 
+=item C<$DropdownMenuLimit>
+
+The Owner dropdown menu, used in various places in RT including the Query
+Builder and ticket edit pages, automatically changes from a dropdown menu to
+an autocomplete field once the menu holds more than the C<$DropdownMenuLimit>
+owners. Dropdown menus become more difficult to use when they contain a large
+number of values and the autocomplete textbox can be more usable.
+
+If you have very large numbers of users who can be owners, this can cause
+slow page loads on pages with an Owner selection. See L</$AutocompleteOwners>
+for a way to potentially speed up page loads.
+
+=cut
+
+Set($DropdownMenuLimit, 50);
+
 =item C<$AutocompleteOwnersForSearch>
 
 If set to 1, the owner drop-downs for the query builder are always
diff --git a/share/html/Elements/SelectOwnerDropdown b/share/html/Elements/SelectOwnerDropdown
index 57f364125..a20a7c343 100644
--- a/share/html/Elements/SelectOwnerDropdown
+++ b/share/html/Elements/SelectOwnerDropdown
@@ -79,7 +79,7 @@ foreach my $object (@$Objects) {
     }
 }
 
-my $dropdown_limit = 50;
+my $dropdown_limit = RT->Config->Get( 'DropdownMenuLimit' ) || 50;
 $m->callback( CallbackName => 'ModifyDropdownLimit', DropdownLimit => \$dropdown_limit );
 
 if (keys(%user_uniq_hash) > $dropdown_limit ) {

-----------------------------------------------------------------------


More information about the rt-commit mailing list