Missing keywords in show_bug.cgi

RESOLVED WORKSFORME

Status

()

Bugzilla
Creating/Changing Bugs
RESOLVED WORKSFORME
16 years ago
6 years ago

People

(Reporter: Jussi Sirpoma, Assigned: myk)

Tracking

Details

(Reporter)

Description

16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212

I recently lost all keywords in show_bug.cgi in a bugzilla installation 
I updated to tip. After a bit of testing, it seems that the problem 
could be solved by removing a join from the line where keywords are listed.

edit.html.tmpl line 265:
value="[% bug.keywords.join(', ') FILTER html %]" size="60">

If I understand the bug hash correctly, bug.keywords is already a string 
formatted as "key1, key2" so the join is redundant but not harmful?

Here is a few tests I used:

[% bug.keywords.join(', ') %]
[% bug.keywords %]
[% bug.keywords.list.join(', ') %]
[% bug.keywords.list.join('xyz') %]

First one returns an empty string, and the other ones a correct list of 
keywords.

My perl version is 5.6.1 and Template toolkit version 2.08.

Reproducible: Always

Steps to Reproduce:
hmm, although the code looks exactly like what you suggest is wrong here, this
works for me on landfill.  I couldn't get it to not display the keywords.
Bug.pm prejoins the keywords, so that join is unneeded, I guess. Although it may
make more sense to return an array, I guess.

Was the field shown, but not blank, or was it just not shown?
(Reporter)

Comment 3

16 years ago
The field was blank. Since I could not reproduce this either in another
computer, this could be a perl configuration issue. 

In report.html.tmpl I needed to join two lines to generate the correct html.
This could be caused by the same thing. The line was this fromaturl line:

[% formaturl = "report.cgi?$switchbase&width=$width&height=$height" _
   "&action=wrap" %]

Is there or what is the best way to debug bugzilla templates? I would imagine
that I need to give at least a few environment variables to show_bug.cgi.
Hmm. Did you at one point install an earlier TT version without using the XS
stash, and then have the current version use XS?

That would cause mixups, because of the different directies + directory search
paths.

Check that all teh Template/.pm files are under the same library root dir.
(Reporter)

Comment 5

16 years ago
That was a good error diagnosis. The server that has this problem is not hosted
by me and it had a template toolkit version 2.06 preinstalled, I installed the
latest 2.08 under my home directory and everything seemed to be ok, until now. I
asked them to upgrade the site version so we will see if that solves the problem.

I had set the PER5LIB environment variable in the main bugzilla dir .htaccess
file to point to the newer version, but is there some other variables that
should be set also?
PERL5LIB doesn't get honored in taint mode.  You can only use the site-wide
modules that way (unless you compiled your own perl as well).
(Reporter)

Comment 7

16 years ago
That's it. When I added the path as a command line -I the script started to work.
Thanks.
per reporter (comment 7)  WORKSFORME
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WORKSFORME
PERL5LIB won't work, because that setting is ignored in taint mode, which
bugzilla uses.

There are a couple of bugs on a configurable library path; we'll probably have
to deal with that before mod_perl.
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.