Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
5d0e6171
Commit
5d0e6171
authored
Sep 26, 2013
by
Dave Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 917483 - Bug.update_attachment causes error when updating filename using key 'file_name'
parent
0bb48df6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
Bug.pm
Bugzilla/WebService/Bug.pm
+19
-6
No files found.
Bugzilla/WebService/Bug.pm
View file @
5d0e6171
...
...
@@ -17,7 +17,7 @@ use Bugzilla::Constants;
use
Bugzilla::
Error
;
use
Bugzilla::
Field
;
use
Bugzilla::WebService::
Constants
;
use
Bugzilla::WebService::
Util
qw(filter filter_wants validate)
;
use
Bugzilla::WebService::
Util
qw(filter filter_wants validate
translate
)
;
use
Bugzilla::
Bug
;
use
Bugzilla::
BugMail
;
use
Bugzilla::
Util
qw(trick_taint trim diff_arrays)
;
...
...
@@ -55,6 +55,20 @@ use constant READ_ONLY => qw(
search
)
;
use
constant
ATTACHMENT_MAPPED_SETTERS
=>
{
file_name
=>
'filename'
,
summary
=>
'description'
,
};
use
constant
ATTACHMENT_MAPPED_RETURNS
=>
{
description
=>
'summary'
,
ispatch
=>
'is_patch'
,
isprivate
=>
'is_private'
,
isobsolete
=>
'is_obsolete'
,
filename
=>
'file_name'
,
mimetype
=>
'content_type'
,
};
######################################################
# Add aliases here for old method name compatibility #
######################################################
...
...
@@ -751,9 +765,8 @@ sub update_attachment {
# We can't update flags, and summary is really description
delete
$params
->
{
flags
};
if
(
exists
$params
->
{
summary
})
{
$params
->
{
description
}
=
delete
$params
->
{
summary
};
}
$params
=
translate
(
$params
,
ATTACHMENT_MAPPED_SETTERS
);
# Get all the attachments, after verifying that they exist and are editable
my
@attachments
=
();
...
...
@@ -782,6 +795,8 @@ sub update_attachment {
foreach
my
$attachment
(
@attachments
)
{
my
$changes
=
$attachment
->
update
();
$changes
=
translate
(
$changes
,
ATTACHMENT_MAPPED_RETURNS
);
my
%
hash
=
(
id
=>
$self
->
type
(
'int'
,
$attachment
->
id
),
last_change_time
=>
$self
->
type
(
'dateTime'
,
$attachment
->
modification_time
),
...
...
@@ -790,8 +805,6 @@ sub update_attachment {
foreach
my
$field
(
keys
%
$changes
)
{
my
$change
=
$changes
->
{
$field
};
# Description is shown as summary to the user
$field
=
'summary'
if
$field
eq
'description'
;
# We normalize undef to an empty string, so that the API
# stays consistent for things like Deadline that can become
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment