Bug 65323 - Pass \$output to template->process() in template_var

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@800 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2010-06-11 17:45:50 +00:00
parent 92393aae6f
commit 6f54be9d01
1 changed files with 2 additions and 16 deletions

View File

@ -657,21 +657,6 @@ sub clean_text {
return trim($dtext);
}
sub load_cached_fielddescs_template
{
my $tt;
unless ($tt = Bugzilla->request_cache->{_global_field_descs_none_tmpl})
{
# создаём отдельный шаблон
$tt = Bugzilla::Template->create();
# хакаемся внутрь контекста и делаем process без localise
$tt = $tt->{SERVICE}->context;
$tt->process('global/field-descs.none.tmpl');
Bugzilla->request_cache->{_global_field_descs_none_tmpl} = $tt;
}
return $tt;
}
# Довольно некрасивый хак для бага см.ниже - на багах с длинным числом комментов
# quoteUrls вызывает на каждый коммент get_text('term', { term => 'bug' }),
# что приводит к ужасной производительности. например, на баге с 703
@ -704,8 +689,9 @@ sub template_var {
my %vars;
# Note: If we suddenly start needing a lot of template_var variables,
# they should move into their own template, not field-descs.
my $output;
my $result = $template->process('global/field-descs.none.tmpl',
{ vars => \%vars, in_template_var => 1 });
{ vars => \%vars, in_template_var => 1 }, \$output);
# Bugzilla::Error can't be "use"d in Bugzilla::Util.
if (!$result) {
require Bugzilla::Error;