Commit f68a37a0 authored by Ruslan Zakirov's avatar Ruslan Zakirov
Browse files

ObjectCustomFieldValue::Create

log error when Content is longer than 255 chars
  and LargeContent is not empty. We still create
  record and content of the Content arg would be
  truncated.

git-svn-id: svn+ssh://svn.bestpractical.com/svn/bps-public/rt/branches/3.7-EXPERIMENTAL@5684 e417ac7c-1bcc-0310-8ffa-8f5827389a85
parent b6c58b0c
......@@ -52,23 +52,26 @@ no warnings qw(redefine);
sub Create {
my $self = shift;
my %args = (
CustomField => '0',
ObjectType => '',
ObjectId => '0',
Disabled => '0',
Content => '',
LargeContent => '',
ContentType => '',
ContentEncoding => '',
@_);
if( $args{'Content'} && length($args{'Content'}) > 255 && !$args{'LargeContent'} ) {
$args{'LargeContent'} = $args{'Content'};
$args{'Content'} = '';
$args{'ContentType'} = 'text/plain';
CustomField => 0,
ObjectType => '',
ObjectId => 0,
Disabled => 0,
Content => '',
LargeContent => undef,
ContentType => '',
ContentEncoding => '',
@_,
);
if ( defined $args{'Content'} && length( $args{'Content'} ) > 255 ) {
if ( defined $args{'LargeContent'} && length $args{'LargeContent'} ) {
$RT::Logger->error("Content is longer than 255 and LargeContent specified");
}
else {
$args{'LargeContent'} = $args{'Content'};
$args{'Content'} = '';
$args{'ContentType'} ||= 'text/plain';
}
}
( $args{'ContentEncoding'}, $args{'LargeContent'} ) =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment