[Rt-commit] rt branch, 4.4/preview-scrips-post, created. rt-4.2.10-120-g20a9c09

Alex Vandiver alexmv at bestpractical.com
Tue Apr 28 13:19:34 EDT 2015


The branch, 4.4/preview-scrips-post has been created
        at  20a9c093c8d69e575695c54f7050f18b96eaa2fe (commit)

- Log -----------------------------------------------------------------
commit e428c4e37ce4cf64cf53129f221ae14b45e15ce0
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Apr 28 13:15:15 2015 -0400

    Only attempt to synchronize "All recipients" box if it exists
    
    setCheckbox takes a single element, not a jQuery collection; while it
    aborted early if passed null, it did not do so if passed an empty
    collection.  This resulted in console errors after every request if
    there were no recipients across all scrips.

diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index f0b8130..001a4eb 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -226,7 +226,9 @@ jQuery( function() {
                txn_send_field.change( syncCheckboxes );
                txn_send_field.click( function () { setCheckbox(this) } );
                jQuery("#recipients input[name=TxnSendMailToAll]").click( function() { setCheckbox(this, 'TxnSendMailTo'); } );
-               setCheckbox(txn_send_field);
+               if (txn_send_field.length > 0) {
+                   setCheckbox(txn_send_field[0]);
+               }
            }
        );
        jQuery('#previewscrips div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/PreviewScrips',
@@ -236,7 +238,9 @@ jQuery( function() {
                txn_send_field.change( syncCheckboxes );
                txn_send_field.click( function () { setCheckbox(this) } );
                jQuery("#previewscrips input[name=TxnSendMailToAll]").click( function() { setCheckbox(this, 'TxnSendMailTo'); } );
-               setCheckbox(txn_send_field);
+               if (txn_send_field.length > 0) {
+                   setCheckbox(txn_send_field[0]);
+               }
            }
        );
    };

commit 20a9c093c8d69e575695c54f7050f18b96eaa2fe
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Apr 28 13:17:43 2015 -0400

    Switch to making POST requests, not GET requests
    
    If passed a string, the .load() function makes a GET request; if passed
    an object, it makes a POST request.  Since GET requests are limited in
    query-string length by the webserver, use a POST rquest to ensure that
    if the helper request is not dropped if the textarea contains a large
    amount of text.

diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index 001a4eb..2a24670 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -220,7 +220,7 @@ jQuery( function() {
            jQuery("input[name=TxnSendMailTo]").filter( function() { return this.value == target.value; } ).prop("checked",jQuery(target).prop('checked'));
        };
        jQuery('#recipients div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/ShowSimplifiedRecipients',
-           jQuery('form[name=TicketUpdate]').serialize(),
+           jQuery('form[name=TicketUpdate]').serializeArray(),
            function() {
                var txn_send_field = jQuery("#recipients input[name=TxnSendMailTo]");
                txn_send_field.change( syncCheckboxes );
@@ -232,7 +232,7 @@ jQuery( function() {
            }
        );
        jQuery('#previewscrips div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/PreviewScrips',
-           jQuery('form[name=TicketUpdate]').serialize(),
+           jQuery('form[name=TicketUpdate]').serializeArray(),
            function() {
                var txn_send_field = jQuery("#previewscrips input[name=TxnSendMailTo]");
                txn_send_field.change( syncCheckboxes );

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


More information about the rt-commit mailing list