[Rt-commit] rt branch 5.0/fix-selectize-removing-group-customroles-on-load created. rt-5.0.4-66-ge30f60d81f

BPS Git Server git at git.bestpractical.com
Wed Jul 19 19:41:34 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/fix-selectize-removing-group-customroles-on-load has been created
        at  e30f60d81ffdfa3060c59d3858621ad0a8bc4b9a (commit)

- Log -----------------------------------------------------------------
commit e30f60d81ffdfa3060c59d3858621ad0a8bc4b9a
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Wed Jul 19 16:22:05 2023 -0300

    Make Principals Helper compatible with EmailInput element
    
    d2b62607 changed the EmailInput element to use not only the Users
    Autocomplete helper, but also Principals.
    
    This patch makes the Principals Autocomplete compatible with the
    EmailInput element, adding option to do not abort Mason execution
    when calling it from Perl code, the same way as Users Autocomplete
    Helper.

diff --git a/share/html/Helpers/Autocomplete/Principals b/share/html/Helpers/Autocomplete/Principals
index 6257be9b60..8f351618bd 100644
--- a/share/html/Helpers/Autocomplete/Principals
+++ b/share/html/Helpers/Autocomplete/Principals
@@ -47,7 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 % $r->content_type('application/json; charset=utf-8');
 <% JSON( \@suggestions ) |n %>
-% $m->abort;
+% $m->abort if $abort;
 <%ARGS>
 $term => undef
 $delim => undef
@@ -56,6 +56,7 @@ $privileged => undef
 $exclude => ''
 $include_nobody => 0
 $include_system => 0
+$abort => 1
 </%ARGS>
 <%INIT>
 $m->callback(

commit d2b6260797729f5a541339222e464d6a7aaec997
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Wed Jul 19 16:18:48 2023 -0300

    Adjust EmailInput element to use the correct autocomplete helper
    
    The EmailInput element was using Autocomplete/Users as a fixed helper
    for generating items and options. This was making Selectize remove group
    values from the list of selected items when the page was loaded with
    pre-filled values.
    
    This patch makes the helper to be the same as the one informed by the
    AutocompleteType parameter.

diff --git a/share/html/Elements/EmailInput b/share/html/Elements/EmailInput
index 1decf5df97..c5f2355479 100644
--- a/share/html/Elements/EmailInput
+++ b/share/html/Elements/EmailInput
@@ -110,7 +110,7 @@ if ($AutocompleteMultiple) {
         my $term = shift;
         return unless $term =~ /\S/;
         my $json = $m->scomp(
-            '/Helpers/Autocomplete/Users',
+            "/Helpers/Autocomplete/$AutocompleteType",
             term => $term,
             op   => '=',
             max  => 1,

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list