[Rt-commit] rtir branch, 2.9/capture-cc-admincc-on-incidents, created. 3.0.0rc1-38-g8c637d3

Kevin Falcone falcone at bestpractical.com
Thu Jan 31 21:38:27 EST 2013


The branch, 2.9/capture-cc-admincc-on-incidents has been created
        at  8c637d34fe5554090db041a638c09c7ffc39ab08 (commit)

- Log -----------------------------------------------------------------
commit dcbcb50903c55ebc772f91489edded941120b39b
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Jan 31 20:28:48 2013 +0000

    Correctly name the AdminCc field
    
    During a copy and paste in 1980249d, we ended up with two
    InvestigationCc fields on the page.  This meant that you could never set
    an AdminCc on an Investigation and that Cc would always submit as an
    arrayref.  Unfortunately, RT::IR->FilterRTAddresses blindly calls
    Email::Address->parse( $value ); on that arrayref, meaning no addresses
    are ever parsed and Cc/AdminCc is silently lost.

diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
index 34feb8e..6e8d757 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -88,7 +88,7 @@ email addresses. These people <b>will</b> receive future updates.)</&></font></i
 % unless ( $SkipField{'AdminCc'} && $HideField{'AdminCc'} ) {
 <tr><td class="label"><&|/l&>Admin Cc</&>:</td>
 <td class="value"><& /Elements/EmailInput,
-    Name => $NamePrefix .'Cc', Default => $value_cb->('Cc'), Size => undef,
+    Name => $NamePrefix .'AdminCc', Default => $value_cb->('AdminCc'), Size => undef,
 &></td></tr>
 <tr><td> </td><td class="comment">
 <i><font size="-2"><&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative

commit 8c637d34fe5554090db041a638c09c7ffc39ab08
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Jan 31 20:35:08 2013 +0000

    Possible warning for FilterRTAddresses
    
    Nothing good can ever come from passing a stringified reference to
    FilterRTAddresses and then Email::Address->Parse.  I'm not sure if I
    should do any magic in this case or just warn loudly and then skip.

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 49ca151..681322a 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -552,6 +552,16 @@ sub FilterRTAddresses {
         my $value = $args{'ARGSRef'}{ $field };
         next unless defined $value && length $value;
 
+        if ( ref $value ) {
+            RT->Logger->warning("FilterRTAddresses received a reference for $field".ref $value);
+            if ( ref $value eq 'ARRAY' ) {
+                $value = join(", ",@$value);
+            } else {
+                RT->Logger->warning("Not an arrayref, nothing good can come from this, bailing");
+                next;
+            }
+        }
+
         my @emails = Email::Address->parse( $value );
         foreach my $email ( grep RT::EmailParser->IsRTAddress($_->address), @emails ) {
             push @{ $args{'results'} }, $cu->loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $email->format, $cu->loc($display) );

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


More information about the Rt-commit mailing list