Closed
Bug 1235270
Opened 9 years ago
Closed 9 years ago
Set submitter_id before calling _check_data()
Categories
(Bugzilla :: Attachments & Requests, defect)
Bugzilla
Attachments & Requests
Tracking
()
RESOLVED
FIXED
Bugzilla 5.0
People
(Reporter: mokhi64, Assigned: mokhi64)
Details
Attachments
(1 file, 2 obsolete files)
747 bytes,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; FreeBSD i386) AppleWebKit/535.22+ (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.22+ Epiphany/2.30.6
Steps to reproduce:
tried to print submitter_id accessed via attachement attributes
Actual results:
printing submitter_id via attachement attributes returns empty object
Expected results:
it should return sumbitter id
![]() |
||
Comment 1•9 years ago
|
||
The point is that we call the hook in Bugzilla::Attachment::_check_data() before setting submitter_id, and so submitter_id is still undefined when the hook is called. This is not a big deal, because the extension can access the user ID with Bugzilla->user->id. But defining submitter_id before calling _check_data() is safe.
Assignee: general → attach-and-request
Severity: normal → minor
Status: UNCONFIRMED → NEW
Component: Bugzilla-General → Attachments & Requests
Ever confirmed: true
Target Milestone: --- → Bugzilla 5.0
Assignee | ||
Comment 2•9 years ago
|
||
Patch that fixes this issue (tnx from LpSolit :D)
Flags: needinfo?(attach-and-request)
![]() |
||
Updated•9 years ago
|
Assignee: attach-and-request → mokhi64
Status: NEW → ASSIGNED
Flags: needinfo?(attach-and-request)
![]() |
||
Comment 3•9 years ago
|
||
Comment on attachment 8702145 [details] [diff] [review]
patch for Bugzilla/Attachment.pm
>+ $params->{creation_ts} ||= Bugzilla->dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
>+ $params->{modification_time} = $params->{creation_ts};
>+ $params->{submitter_id} = Bugzilla->user->id || ThrowUserError('invalid_user');
Hum no, only move submitter_id here. Leave the other two where they are currently. They will be set when the attachment is ready to be uploaded.
Attachment #8702145 -
Flags: review-
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8702145 -
Attachment is obsolete: true
Attachment #8702147 -
Flags: review?(LpSolit)
Attachment #8702147 -
Flags: feedback?(LpSolit)
![]() |
||
Comment 5•9 years ago
|
||
Comment on attachment 8702147 [details] [diff] [review]
newer patch for Bugzilla/Attachment.pm
>+ #moved for fixing bug #1235270
This comment is useless and should be removed on checkin. Otherwise your patch is ok, so r=LpSolit. Thanks for the patch! :)
Attachment #8702147 -
Flags: review?(LpSolit)
Attachment #8702147 -
Flags: review+
Attachment #8702147 -
Flags: feedback?(LpSolit)
![]() |
||
Updated•9 years ago
|
Flags: approval5.0?
Assignee | ||
Comment 6•9 years ago
|
||
removed extra comment in patch.
Attachment #8702147 -
Attachment is obsolete: true
Attachment #8702149 -
Flags: review?(LpSolit)
![]() |
||
Comment 7•9 years ago
|
||
Comment on attachment 8702149 [details] [diff] [review]
even newer patch for Bugzilla/Attachment.pm
r=LpSolit
Attachment #8702149 -
Flags: review?(LpSolit) → review+
Updated•9 years ago
|
Flags: approval5.0? → approval5.0+
![]() |
||
Comment 8•9 years ago
|
||
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
7829cc8..66e373d master -> master
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
f729352..6e6093a 5.0 -> 5.0
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•