[Rt-commit] rt branch, 4.2/record-attachments-dropping, repushed
? sunnavy
sunnavy at bestpractical.com
Wed Aug 13 12:24:10 EDT 2014
The branch 4.2/record-attachments-dropping was deleted and repushed:
was a3aaa712f8905cd4620f6b7c5b9183e4a3c90dc8
now cac2bcff502dff07d679bcb19d08b93347857929
1: c610009 ! 1: 15dddd2 record attachments' dropping/truncation as txns
@@ -81,7 +81,7 @@
$Body = substr( $Body, 0, $MaxSize );
+ $note_args = {
+ Type => 'AttachmentTruncate',
-+ Data => defined $Filename ? $Filename : 'Content',
++ Data => $Filename,
+ OldValue => $size,
+ NewValue => $MaxSize,
+ ActivateScrips => 0,
@@ -101,7 +101,7 @@
- return ("none", "Large attachment dropped", "text/plain", $Filename );
+ $note_args = {
+ Type => 'AttachmentDrop',
-+ Data => defined $Filename ? $Filename : 'Content',
++ Data => $Filename,
+ OldValue => $size,
+ NewValue => $MaxSize,
+ ActivateScrips => 0,
@@ -130,13 +130,25 @@
},
+ AttachmentTruncate => sub {
+ my $self = shift;
-+ return ( "[_1] truncated because its size ([_2] bytes) exceeded configured maximum size setting ([_3] bytes).",
-+ $self->Data // loc( "Content" ), $self->OldValue, $self->NewValue ); #loc()
++ if ( defined $self->Data ) {
++ return ( "File '[_1]' truncated because its size ([_2] bytes) exceeded configured maximum size setting ([_3] bytes).",
++ $self->Data, $self->OldValue, $self->NewValue ); #loc()
++ }
++ else {
++ return ( "Content truncated because its size ([_1] bytes) exceeded configured maximum size setting ([_2] bytes).",
++ $self->OldValue, $self->NewValue ); #loc()
++ }
+ },
+ AttachmentDrop => sub {
+ my $self = shift;
-+ return ( "[_1] dropped because its size ([_2] bytes) exceeded configured maximum size setting ([_3] bytes).",
-+ $self->Data // loc( "Content" ), $self->OldValue, $self->NewValue ); #loc()
++ if ( defined $self->Data ) {
++ return ( "File '[_1]' dropped because its size ([_2] bytes) exceeded configured maximum size setting ([_3] bytes).",
++ $self->Data, $self->OldValue, $self->NewValue ); #loc()
++ }
++ else {
++ return ( "Content dropped because its size ([_1] bytes) exceeded configured maximum size setting ([_2] bytes).",
++ $self->OldValue, $self->NewValue ); #loc()
++ }
+ },
"Forward Transaction" => sub {
my $self = shift;
2: 216dedf ! 2: 1545237 test attachment dropping/truncation
@@ -51,7 +51,7 @@
+$m->submit;
+is( $m->status, 200, "request successful" );
+
-+$m->content_contains( "$name dropped because its size (1010 bytes) exceeded configured maximum size setting (1000 bytes).", 'dropped message' );
++$m->content_contains( "File '$name' dropped because its size (1010 bytes) exceeded configured maximum size setting (1000 bytes).", 'dropped message' );
+$m->content_lacks( 'cfaaaa', 'cf value was dropped' );
+$m->follow_link_ok( { text => "Download $name" } );
+is( $m->content, 'Large attachment dropped', 'dropped $name' );
@@ -107,7 +107,7 @@
+$m->submit;
+is( $m->status, 200, "request successful" );
+
-+$m->content_contains( "$name truncated because its size (1010 bytes) exceeded configured maximum size setting (1000 bytes).", 'truncated message' );
++$m->content_contains( "File '$name' truncated because its size (1010 bytes) exceeded configured maximum size setting (1000 bytes).", 'truncated message' );
+$m->content_contains( 'cf' . 'a' x 998, 'has the first 1000 cf chars' );
+$m->content_lacks( 'aaacfb', 'lacks cf chars after that' );
+$m->follow_link_ok( { text => "Download $name" } );
3: 8fc4cff = 3: 4aaa132 make attachment truncate/drop and error txns more noticeable
4: a3aaa71 = 4: cac2bcf refactor email sent failure system error txn to use the same tech as Attachment Truncate/Drop.
More information about the rt-commit
mailing list