[Rt-commit] rt branch, 4.2/empty-requestor-on-resubmit, created. rt-4.2.3-27-g4eee9f0

Alex Vandiver alexmv at bestpractical.com
Fri Mar 7 17:10:35 EST 2014


The branch, 4.2/empty-requestor-on-resubmit has been created
        at  4eee9f0355514afb2d25d3fc479290fc343bd189 (commit)

- Log -----------------------------------------------------------------
commit 4eee9f0355514afb2d25d3fc479290fc343bd189
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Mar 7 16:46:37 2014 -0500

    Ensure than an empty requestor is preserved across "Add More Files"
    
    The use if $ARGS{Requestor} || 'something' as the default value for the
    Requestor field means that if emptied, and the create does not go
    through -- either because the "Add More Files" button was pressed, or
    fields vailed validation, or an extension halted it -- then the
    Requestor will pop back to being the current user.
    
    Preserve the user's wishes, by using a defined-or to only set the
    default if it was _unsubmitted_.  Note that this is a minor behavior
    change, in that external links to Create.html?Requestors=&Queue=1
    previously got the current user as the requestor, instead of no
    requestors.  However, this is an unlikely scenario, and they are now
    actually getting what they asked.
    
    This leaves the remaining defaults to use ||; changing them is left to a
    more comprehensive branch.

diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 57e66df..103b57a 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -127,7 +127,7 @@
 <&|/l&>Requestors</&>:
 </td>
 <td class="value" colspan="5">
-<& /Elements/EmailInput, Name => 'Requestors', Size => undef, Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress, AutocompleteMultiple => 1 &>
+<& /Elements/EmailInput, Name => 'Requestors', Size => undef, Default => $ARGS{Requestors} // $session{CurrentUser}->EmailAddress, AutocompleteMultiple => 1 &>
 % $m->callback( CallbackName => 'AfterRequestors', QueueObj => $QueueObj, ARGSRef => \%ARGS );
 </td>
 </tr>
diff --git a/share/html/m/ticket/create b/share/html/m/ticket/create
index af25bd0..e01956f 100644
--- a/share/html/m/ticket/create
+++ b/share/html/m/ticket/create
@@ -269,7 +269,7 @@ $showrows->(
         "/Elements/EmailInput",
         Name    => 'Requestors',
         Size    => '40',
-        Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress
+        Default => $ARGS{Requestors} // $session{CurrentUser}->EmailAddress
     ),
 
     loc("Cc") =>

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


More information about the rt-commit mailing list