Bug 40933 - force_attach_bigfile debug
git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1071 6955db30-a419-402b-8a0d-67ecbb4d7f56master
parent
811fffd584
commit
4fde15fabf
|
@ -653,7 +653,9 @@ sub _check_is_url {
|
|||
sub _check_store_in_file {
|
||||
my ($invocant, $store_in_file) = @_;
|
||||
|
||||
if ($store_in_file && !Bugzilla->params->{'maxlocalattachment'}) {
|
||||
if (($store_in_file || Bugzilla->params->{force_attach_bigfile}) &&
|
||||
!Bugzilla->params->{'maxlocalattachment'})
|
||||
{
|
||||
ThrowCodeError('attachment_local_storage_disabled');
|
||||
}
|
||||
return $store_in_file ? 1 : 0;
|
||||
|
@ -844,6 +846,12 @@ sub create {
|
|||
my $fh = delete $params->{data};
|
||||
my $store_in_file = delete $params->{store_in_file};
|
||||
|
||||
if (Bugzilla->params->{force_attach_bigfile})
|
||||
{
|
||||
# Force uploading into files instead of DB when force_attach_bigfile = On
|
||||
$store_in_file = 1;
|
||||
}
|
||||
|
||||
my $attachment = $class->insert_create_data($params);
|
||||
my $attachid = $attachment->id;
|
||||
|
||||
|
|
|
@ -510,13 +510,6 @@ sub insert {
|
|||
Encode::_utf8_on($filename);
|
||||
}
|
||||
|
||||
my $store_in_file = $cgi->param('bigfile');
|
||||
if (Bugzilla->params->{force_attach_bigfile})
|
||||
{
|
||||
# Force uploading into files instead of DB when force_attach_bigfile = On
|
||||
$store_in_file = 1;
|
||||
}
|
||||
|
||||
my $attachment = Bugzilla::Attachment->create(
|
||||
{bug => $bug,
|
||||
creation_ts => $timestamp,
|
||||
|
@ -527,7 +520,7 @@ sub insert {
|
|||
isprivate => scalar $cgi->param('isprivate'),
|
||||
isurl => scalar $cgi->param('attachurl'),
|
||||
mimetype => $content_type,
|
||||
store_in_file => $store_in_file,
|
||||
store_in_file => scalar $cgi->param('bigfile'),
|
||||
});
|
||||
|
||||
foreach my $obsolete_attachment (@obsolete_attachments) {
|
||||
|
|
Loading…
Reference in New Issue