Closed Bug 576911 Opened 15 years ago Closed 15 years ago

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

Categories

(Bugzilla :: Administration, task)

task
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: LpSolit, Assigned: mkanat)

Details

Attachments

(1 file, 1 obsolete file)

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.
(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.
Marking as blocker for further investigation.
Flags: blocking4.0+
Flags: blocking3.6.2+
Target Milestone: --- → Bugzilla 3.6
Attached patch v1 (obsolete) — Splinter Review
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)
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-
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.
Attached patch v2Splinter Review
Ah, right. :-)
Attachment #456208 - Attachment is obsolete: true
Attachment #456213 - Flags: review?(LpSolit)
Comment on attachment 456213 [details] [diff] [review] v2 Now works fine. Thanks! r=LpSolit
Attachment #456213 - Flags: review?(LpSolit) → review+
Flags: approval3.6+
Flags: approval+
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
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: