[Rt-commit] rt branch, 4.2/record-attachments-dropping, updated. rt-4.0.1-239-g15b75a8
? sunnavy
sunnavy at bestpractical.com
Thu Oct 18 11:37:33 EDT 2012
The branch, 4.2/record-attachments-dropping has been updated
via 15b75a8f81cae5e59d2d1240924f9a1e53c080d0 (commit)
via 96325189210945317f74272d1256a9db5969d357 (commit)
from a80a65fbb8fafe0c4f12487e3f93c931de3dab3a (commit)
Summary of changes:
lib/RT/Attachment.pm | 9 +++++----
lib/RT/Config.pm | 19 +++++++++++++++++++
2 files changed, 24 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 96325189210945317f74272d1256a9db5969d357
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 18 22:50:13 2012 +0800
refactor to allow all objects that can _RecordNote
diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm
index f7df9b9..1b1a716 100644
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@ -212,12 +212,13 @@ sub Create {
if ($id) {
if ($note_args) {
- my $ticket = $self->TransactionObj->TicketObj;
- if ( $ticket && $ticket->isa('RT::Ticket') ) {
- $ticket->_RecordNote(%$note_args);
+ my $object = $self->TransactionObj->Object;
+ if ( $object && $object->can('_RecordNote') ) {
+ $object->_RecordNote(%$note_args);
}
else {
- $RT::Logger->error("only ticket supports RecordNote");
+ $RT::Logger->error(
+ ref($object) . " doesn't support _RecordNote" );
}
}
}
commit 15b75a8f81cae5e59d2d1240924f9a1e53c080d0
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 18 23:14:18 2012 +0800
warn if MaxAttachmentSize is set to ridiculously small
since we also record drop/truncate message in attachments, a small value could
result in endless loop
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 423e8fa..786e0f4 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -777,6 +777,25 @@ lifecycle and add transition rules; see RT_Config.pm for documentation.
EOT
},
},
+ MaxAttachmentSize => {
+ Type => 'SCALAR',
+ PostLoadCheck => sub {
+ my $self = shift;
+ my $value = shift || 0;
+ if (
+ $value < 1_024
+ && ( $self->Get('TruncateLongAttachments')
+ || $self->Get('DropLongAttachments') )
+ )
+ {
+ warn <<EOT;
+MaxAttachmentSize is too small, you may end in endless loop with
+TruncateLongAttachments or DropLongAttachments enabled. You should set it to
+at least 1024(1k).
+EOT
+ }
+ },
+ },
);
my %OPTIONS = ();
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list