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
e4dfffc2
Commit
e4dfffc2
authored
Nov 10, 2009
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 526165: Make it impossible to set creation_ts via Bugzilla::Bug->create
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat
parent
4b2c9f0f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
14 deletions
+12
-14
Bug.pm
Bugzilla/Bug.pm
+3
-3
Migrate.pm
Bugzilla/Migrate.pm
+5
-0
Bug.pm
Bugzilla/WebService/Bug.pm
+0
-7
post_bug.cgi
post_bug.cgi
+4
-4
No files found.
Bugzilla/Bug.pm
View file @
e4dfffc2
...
...
@@ -590,10 +590,10 @@ sub run_create_validators {
$class
->
_check_qa_contact
(
$params
->
{
qa_contact
},
$component
);
$params
->
{
cc
}
=
$class
->
_check_cc
(
$component
,
$params
->
{
cc
});
# Callers cannot set
Reporter, currently
.
# Callers cannot set
reporter, creation_ts, or delta_ts
.
$params
->
{
reporter
}
=
$class
->
_check_reporter
();
$params
->
{
creation_ts
}
||=
Bugzilla
->
dbh
->
selectrow_array
(
'SELECT LOCALTIMESTAMP(0)'
);
$params
->
{
creation_ts
}
=
Bugzilla
->
dbh
->
selectrow_array
(
'SELECT LOCALTIMESTAMP(0)'
);
$params
->
{
delta_ts
}
=
$params
->
{
creation_ts
};
if
(
$params
->
{
estimated_time
})
{
...
...
Bugzilla/Migrate.pm
View file @
e4dfffc2
...
...
@@ -768,6 +768,11 @@ sub insert_bugs {
$self
->
debug
(
'Created bug '
.
$created
->
id
);
Bugzilla
->
set_user
(
$super_user
);
if
(
defined
$bug
->
{
creation_ts
})
{
$dbh
->
do
(
'UPDATE bugs SET creation_ts = ?, delta_ts = ?
WHERE bug_id = ?'
,
undef
,
$bug
->
{
creation_ts
},
$bug
->
{
creation_ts
},
$created
->
id
);
}
if
(
defined
$bug
->
{
delta_ts
})
{
$dbh
->
do
(
'UPDATE bugs SET delta_ts = ? WHERE bug_id = ?'
,
undef
,
$bug
->
{
delta_ts
},
$created
->
id
);
...
...
Bugzilla/WebService/Bug.pm
View file @
e4dfffc2
...
...
@@ -282,17 +282,10 @@ sub search {
sub
create
{
my
(
$self
,
$params
)
=
@_
;
Bugzilla
->
login
(
LOGIN_REQUIRED
);
$params
=
_map_fields
(
$params
);
# WebService users can't set the creation date of a bug.
delete
$params
->
{
'creation_ts'
};
my
$bug
=
Bugzilla::
Bug
->
create
(
$params
);
Bugzilla::BugMail::
Send
(
$bug
->
bug_id
,
{
changer
=>
$bug
->
reporter
->
login
});
return
{
id
=>
$self
->
type
(
'int'
,
$bug
->
bug_id
)
};
}
...
...
post_bug.cgi
View file @
e4dfffc2
...
...
@@ -103,9 +103,6 @@ if (defined $cgi->param('maketemplate')) {
umask
0
;
# get current time
my
$timestamp
=
$dbh
->
selectrow_array
(
'SELECT LOCALTIMESTAMP(0)'
);
# Group Validation
my
@selected_groups
;
foreach
my
$group
(
grep
(
/^bit-\d+$/
,
$cgi
->
param
()))
{
...
...
@@ -160,7 +157,6 @@ my %bug_params;
foreach
my
$field
(
@bug_fields
)
{
$bug_params
{
$field
}
=
$cgi
->
param
(
$field
);
}
$bug_params
{
'creation_ts'
}
=
$timestamp
;
$bug_params
{
'cc'
}
=
[
$cgi
->
param
(
'cc'
)];
$bug_params
{
'groups'
}
=
\
@selected_groups
;
$bug_params
{
'comment'
}
=
$comment
;
...
...
@@ -176,6 +172,10 @@ my $bug = Bugzilla::Bug->create(\%bug_params);
# Get the bug ID back.
my
$id
=
$bug
->
bug_id
;
# We do this directly from the DB because $bug->creation_ts has the seconds
# formatted out of it (which should be fixed some day).
my
$timestamp
=
$dbh
->
selectrow_array
(
'SELECT creation_ts FROM bugs WHERE bug_id = ?'
,
undef
,
$id
);
# Set Version cookie, but only if the user actually selected
# a version on the page.
...
...
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