Using I frame to contain the additional Comments section

Casey Gregoire caseyg at chsamerica.com
Fri May 2 19:31:41 UTC 2003


I don't have the time allotted to me here to take on such an endeavor. As it
is we want a bunch of custom fields implemented before I think the custom
fields option in Bugzilla is usable so I am going to have to devote time to
doing that. That's why when I make a change like today it has to be short
and simple. I am not to savvy with perl yet either. Implementing Bugzilla
was a small side project for me in the grand scheme of things.

Thanks,
	Casey Gregoire

 -----Original Message-----
From: 	Myk Melez [mailto:myk at mozilla.org] 
Sent:	Friday, May 02, 2003 2:38 PM
To:	developers at bugzilla.org
Subject:	Re: Using I frame to contain the additional Comments section

Casey Gregoire wrote:

>Can anyone tell me if there was a better way to go about doing this that
>would query the database only once? (I don't want to have to change the
>actual source code of Bugzilla if I can avoid it.)
>
Currently Bugzilla generally assumes that every template wants to 
display everything it can, since templates were originally ported from 
inline HTML in the Perl script, where only one format was ever 
possible.  Bugzilla thus pushes all the data at the template, which 
decides what data to display.

Now that we have templates and multiple formats, we need to change that 
model so that Bugzilla merely hands the template a reference to a bug 
object, the template requests data from the bug object, and the bug 
object gets data from the database on demand.  The template then pulls 
the data it wants when it wants it, and it doesn't pull any data it 
doesn't want.  You still incur the cost of instantiating the script a 
second time in this model, but that cost will be effectively eliminated 
when mod_perl/SpeedyCGI support gets implemented (work on this is ongoing).

Unfortunately not much work is happening on switching from push to pull 
models, but fortunately some work has already been done, and one of the 
pieces that was done was comments on the "show bug" page, so when you go 
to the "show bug" page for a specific bug, show_bug.cgi hands the 
template a bug object, and that bug object doesn't pull comments from 
the database until the template calls its "longdesc" method.

Just make sure you aren't calling that method in the main template, and 
you should be able to save the cost of pulling that data twice.  You'll 
still pull other data twice, because the bug object assumes you want a 
base set of data that you probably don't need in the comments iframe.  
Perhaps you'd be interested in taking on the task of fixing that by 
converting it over to a pull model?

-myk


----
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=caseyg@chsamerica.com>



More information about the developers mailing list