The default bug view has changed. See this FAQ.

The "before_table" hook throws "uninitialized value" errors in the web server log

RESOLVED FIXED in Bugzilla 3.6

Status

()

Bugzilla
Administration
--
minor
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Frédéric Buclin, Assigned: Max Kanat-Alexander)

Tracking

Bugzilla 3.6
Bug Flags:
approval +
blocking4.0 +
approval3.6 +
blocking3.6.2 +

Details

Attachments

(1 attachment, 1 obsolete attachment)

v2
1.02 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Reporter)

Description

7 years ago
When listing components (editcomponents.cgi), the following errors appear:

editcomponents.cgi: Use of uninitialized value $template_name in concatenation (.) or string at Bugzilla/Template/Plugin/Hook.pm line 60.
editcomponents.cgi: Use of uninitialized value $type in concatenation (.) or string at Bugzilla/Template/Plugin/Hook.pm line 60.

The corresponding line in Hook.pm is:

  my $extension_template = "$path$template_name-$hook_name.$type.tmpl";

They are undefined because these variables are defined by:

    $filename =~ m/(.+)\.(.+)\.tmpl$/;
    my $template_name = $1;
    my $type = $2;

but $filename contains the name of the component instead of "list.html.tmpl". This problem doesn't occur when listing milestones or versions.
(Reporter)

Comment 1

7 years ago
(In reply to comment #0)
> but $filename contains the name of the component instead of "list.html.tmpl".

Oh, I'm pretty sure this is because of this line:

$template ||= $context->stash->{component}->{name};

component.name is probably overriden by the name of the product's component, which explains why this problem only happens when listing components.
(Reporter)

Comment 2

7 years ago
Marking as blocker for further investigation.
Flags: blocking4.0+
Flags: blocking3.6.2+
Target Milestone: --- → Bugzilla 3.6
(Assignee)

Comment 3

7 years ago
Created attachment 456208 [details] [diff] [review]
v1

I actually can't reproduce that warning. However, does this fix it for you?
Assignee: administration → mkanat
Status: NEW → ASSIGNED
Attachment #456208 - Flags: review?(LpSolit)
(Reporter)

Comment 4

7 years ago
Comment on attachment 456208 [details] [diff] [review]
v1

It does, but now user IDs are displayed instead of login names.
Attachment #456208 - Flags: review?(LpSolit) → review-
(Reporter)

Comment 5

7 years ago
Comment on attachment 456208 [details] [diff] [review]
v1

>+[% FOREACH my_component = product.components %]
>   [% overrides.initialowner.name.${component.name} = {

>   [% overrides.initialqacontact.name.${component.name} = {

You forgot to replace component by my_component here too.
(Assignee)

Comment 6

7 years ago
Created attachment 456213 [details] [diff] [review]
v2

Ah, right. :-)
Attachment #456208 - Attachment is obsolete: true
Attachment #456213 - Flags: review?(LpSolit)
(Reporter)

Comment 7

7 years ago
Comment on attachment 456213 [details] [diff] [review]
v2

Now works fine. Thanks! r=LpSolit
Attachment #456213 - Flags: review?(LpSolit) → review+
(Reporter)

Updated

7 years ago
Flags: approval3.6+
Flags: approval+
(Assignee)

Comment 8

7 years ago
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified template/en/default/admin/components/list.html.tmpl
Committed revision 7286.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.6/
modified template/en/default/admin/components/list.html.tmpl
Committed revision 7123.
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.