Closed
Bug 523762
Opened 16 years ago
Closed 16 years ago
template-before_process hook causes infinite recursion if it throws an error
Categories
(Bugzilla :: Extensions, defect, P1)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.6
People
(Reporter: mkanat, Assigned: mkanat)
References
Details
(Whiteboard: [es-ita])
Attachments
(1 file, 3 obsolete files)
|
3.39 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
Bugzilla::Error uses Template::process to throw errors, so if the template-before_process hook itself throws an error, you get an infinite recursion.
| Assignee | ||
Updated•16 years ago
|
Summary: Template::before_process hooks causes infinite recursion if it throws an error → Template::before_process hook causes infinite recursion if it throws an error
| Assignee | ||
Updated•16 years ago
|
Summary: Template::before_process hook causes infinite recursion if it throws an error → template-before_process hook causes infinite recursion if it throws an error
| Assignee | ||
Comment 1•16 years ago
|
||
Actually, I think this is a more general problem--namely that hooks can recurse infinitely a bit too easily. However, SOMETIMES you might want a hook to recurse, in limited circumstances. I can't think of what they would be, but I assume it could happen.
| Assignee | ||
Comment 2•16 years ago
|
||
Okay, here's a fairly elegant solution to the problem. For now I'm limiting it to the template-before_process hook, because we can actually tell pretty well whether we want to allow recursion or not.
| Assignee | ||
Comment 3•16 years ago
|
||
I realized that hook recursion would also be overwriting hook_args, so I've fixed that in this version. (Technically that's a bug that could affect the branches as well, but I haven't heard anybody mention it yet and it's quite a complex fix.)
Attachment #407709 -
Attachment is obsolete: true
Attachment #409480 -
Flags: review?(dkl)
Attachment #407709 -
Flags: review?(dkl)
| Assignee | ||
Comment 4•16 years ago
|
||
I'd forgotten the Bugzilla.pm part of the patch.
Attachment #409480 -
Attachment is obsolete: true
Attachment #409481 -
Flags: review?(dkl)
Attachment #409480 -
Flags: review?(dkl)
| Assignee | ||
Updated•16 years ago
|
Whiteboard: [es-ita]
| Assignee | ||
Updated•16 years ago
|
Severity: normal → major
| Assignee | ||
Updated•16 years ago
|
Component: Bugzilla-General → Extensions
| Assignee | ||
Comment 5•16 years ago
|
||
Here we go. This fixes the bitrot and is much simpler than the old patch.
Attachment #409481 -
Attachment is obsolete: true
Attachment #415300 -
Flags: review?(dkl)
Attachment #409481 -
Flags: review?(dkl)
| Assignee | ||
Updated•16 years ago
|
Priority: -- → P1
Comment 6•16 years ago
|
||
Comment on attachment 415300 [details] [diff] [review]
v4
Looks good and solved the recursion problem in my test cases. r=dkl
Attachment #415300 -
Flags: review?(dkl) → review+
| Assignee | ||
Updated•16 years ago
|
Flags: approval+
| Assignee | ||
Comment 7•16 years ago
|
||
Checking in Bugzilla/Hook.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Hook.pm,v <-- Hook.pm
new revision: 1.46; previous revision: 1.45
done
Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v <-- Template.pm
new revision: 1.122; previous revision: 1.121
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•