Closed
Bug 395451
Opened 17 years ago
Closed 15 years ago
Bugzilla::BugMail needs to use Bug objects internally instead of direct SQL
Categories
(Bugzilla :: Email Notifications, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.0
People
(Reporter: mkanat, Assigned: reed)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 5 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
Right now Bugzilla::BugMail does all sorts of complicated things to populate %values in its Send() subroutine. All of this data could easily be gotten from a single Bugzilla::Bug object.
Once we have multi-select fields, this will be particularly important, since the values of multi-select fields aren't stored in the bug table, and thus won't show up in "New: " bugmails unless we do this.
Reporter | ||
Comment 1•17 years ago
|
||
This is a work-in-progress. It compiles, but it almost certainly doesn't work yet.
Reporter | ||
Comment 2•17 years ago
|
||
Bugzilla 3.2 is now frozen. Only enhancements blocking 3.2 or specifically approved for 3.2 may be checked in to the 3.2 branch. If you would like to nominate your enhancement for Bugzilla 3.2, set the "blocking3.2" flag to "?", and either the target milestone will be changed back, or the blocking3.2 flag will be granted, if we will accept this enhancement for Bugzilla 3.2.
Target Milestone: Bugzilla 3.2 → Bugzilla 4.0
Assignee | ||
Comment 3•15 years ago
|
||
This is blocking a bug I'm working on, so I'm going to take this.
Assignee | ||
Updated•15 years ago
|
Target Milestone: Bugzilla 4.0 → Bugzilla 3.8
Assignee | ||
Comment 4•15 years ago
|
||
runtests.pl passes fine with this. Still yet to actually test it, however. That's next.
https://landfill.bugzilla.org/bz395451/
Attachment #442589 -
Attachment is obsolete: true
Assignee | ||
Comment 5•15 years ago
|
||
This works based on my testing... I have a few more things to test, but going ahead and posting it for initial review.
Attachment #442604 -
Attachment is obsolete: true
Attachment #442648 -
Flags: review?(mkanat)
Assignee | ||
Comment 6•15 years ago
|
||
Noticed I wasn't updating $bug->{lastdiffed} after changing it in the DB, so fixed that.
One thing I did notice is that Bugzilla::BugMail::create() and Bugzilla::BugMail::update() modify `delta_ts` directly in the DB for other bugs (dependent / blocking). What happens to bug objects that might already be in memory somehow with a (now) obsolete `delta_ts` field? ... or would that never happen / not be possible? Figured I'd mention it, at least...
Attachment #442648 -
Attachment is obsolete: true
Attachment #442652 -
Flags: review?(mkanat)
Attachment #442648 -
Flags: review?(mkanat)
Assignee | ||
Comment 7•15 years ago
|
||
Comment on attachment 442652 [details] [diff] [review]
patch - v1.1
>+ my @fields = Bugzilla->get_fields({obsolete => 0});
One small optimization would be to add |in_new_bugmail => 1| to the get_fields() call, which would allow me to drop this check from a loop:
>+ foreach my $field (@fields) {
>+ # Skip if this field shouldn't be shown in new bugmail
>+ next unless $field->in_new_bugmail;
Reporter | ||
Comment 8•15 years ago
|
||
(In reply to comment #6)
> One thing I did notice is that Bugzilla::BugMail::create() and
> Bugzilla::BugMail::update() modify `delta_ts` directly in the DB for other bugs
> (dependent / blocking). What happens to bug objects that might already be in
> memory somehow with a (now) obsolete `delta_ts` field? ... or would that never
> happen / not be possible? Figured I'd mention it, at least...
Those objects aren't re-used, so it's OK. There's no global cache of bug objects.
Reporter | ||
Updated•15 years ago
|
Attachment #442652 -
Flags: review?(mkanat) → review+
Reporter | ||
Comment 9•15 years ago
|
||
Comment on attachment 442652 [details] [diff] [review]
patch - v1.1
This looks great. I'm really impressed with how awesome this patch is, actually. :-)
Reporter | ||
Updated•15 years ago
|
Flags: approval+
Reporter | ||
Updated•15 years ago
|
Keywords: relnote
Whiteboard: [relnote that "changer" must now be an object]
Assignee | ||
Comment 10•15 years ago
|
||
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified attachment.cgi
modified editusers.cgi
modified email_in.pl
modified importxml.pl
modified post_bug.cgi
modified process_bug.cgi
modified sanitycheck.cgi
modified Bugzilla/Bug.pm
modified Bugzilla/BugMail.pm
modified Bugzilla/User.pm
modified Bugzilla/WebService/Bug.pm
modified contrib/sendbugmail.pl
modified extensions/Voting/Extension.pm
modified template/en/default/email/newchangedmail.txt.tmpl
Committed revision 7150.
Attachment #442652 -
Attachment is obsolete: true
Assignee | ||
Updated•15 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 11•15 years ago
|
||
After this change I started getting the follow error:
"in_new_bugmail is not a valid parameter for the Bugzilla::Field::match function."
What should be the problem?
Comment 12•15 years ago
|
||
(In reply to comment #11)
> After this change I started getting the follow error:
>
> "in_new_bugmail is not a valid parameter for the Bugzilla::Field::match
> function."
>
> What should be the problem?
When submitting a new bug, post_bug.cgi.
Reporter | ||
Updated•14 years ago
|
Whiteboard: [relnote that "changer" must now be an object]
You need to log in
before you can comment on or make changes to this bug.
Description
•