Closed
Bug 783222
Opened 12 years ago
Closed 12 years ago
Make set_all() throw error on invalid param names
Categories
(Bugzilla :: Bugzilla-General, enhancement)
Bugzilla
Bugzilla-General
Tracking
()
RESOLVED
FIXED
Bugzilla 4.4
People
(Reporter: koosha.khajeh, Assigned: koosha.khajeh)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file, 1 obsolete file)
862 bytes,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Attachment #652397 -
Flags: review?(dkl)
Attachment #652397 -
Flags: review?(LpSolit)
Comment 1•12 years ago
|
||
Comment on attachment 652397 [details] [diff] [review] patch - v1 Review of attachment 652397 [details] [diff] [review]: ----------------------------------------------------------------- Looks fine and works as expected. r=dkl
Attachment #652397 -
Flags: review?(dkl) → review+
Updated•12 years ago
|
Flags: approval?
Comment 3•12 years ago
|
||
Comment on attachment 652397 [details] [diff] [review] patch - v1 >+ # First check for any invalid method then proceed to call those methods >+ foreach my $key (@sorted_names) { >+ next if !exists $field_values{$key}; >+ my $method = "set_$key"; Please don't duplicate code. This is the exact same code as the following loop. It's fine to check if a method exists and call it immediately if it does. I don't see the point to do this check separately. >+ if (!$self->can($method)) { >+ my $class = ref($self) || $self; >+ ThrowCodeError("unknown_method", { method => "${class}::${method}" }); >+ } This is the only code you need to add, in the existing loop and right before the method is called.
Attachment #652397 -
Flags: review?(LpSolit) → review-
Updated•12 years ago
|
Flags: approval?
Attachment #652397 -
Attachment is obsolete: true
Attachment #657378 -
Flags: review?(LpSolit)
Comment 5•12 years ago
|
||
Comment on attachment 657378 [details] [diff] [review] patch - v1.1 Looks good. r=LpSolit
Attachment #657378 -
Flags: review?(LpSolit) → review+
Updated•12 years ago
|
Flags: approval4.4+
Flags: approval+
Comment 6•12 years ago
|
||
Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/4.4 modified Bugzilla/Object.pm Committed revision 8374. Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/trunk modified Bugzilla/Object.pm Committed revision 8376.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Please remove my IRC nick ([:koosha]) from my name on bzr. Thanks. :-)
Comment 8•12 years ago
|
||
(In reply to Koosha Khajeh Moogahi [:koosha] from comment #7) > Please remove my IRC nick ([:koosha]) from my name on bzr. Thanks. :-) Sorry bout that. From looking around, I do not see a way to edit a previous commits attributes such as author without manual editing on the bzr server. Maybe someone else has an idea. I will be more careful in the future to not include your IRC nick. dkl
You need to log in
before you can comment on or make changes to this bug.
Description
•