Closed Bug 300448 Opened 19 years ago Closed 19 years ago

undef error - Can't use string ("") as a HASH ref while "strict refs" in use at Bugzilla/BugMail.pm line 118

Categories

(Bugzilla :: Email Notifications, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: zerobug, Unassigned)

References

()

Details

(Whiteboard: [READ COMMENTS #8 and #10])

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
Build Identifier: 

After upgrading Bugzilla 2.18 to 2.18.3, I've got the following error when I 
submit a bug :
undef error - Can't use string ("") as a HASH ref while "strict refs" in use at 
Bugzilla/BugMail.pm line 118

Reproducible: Always

Steps to Reproduce:
1. Create a new bug
2. Submit the bug

Actual Results:  
undef error - Can't use string ("") as a HASH ref while "strict refs" in use at 
Bugzilla/BugMail.pm line 118
The mail is not delivered.

Expected Results:  
no error !

The line 118 in Bugzilla/BugMail.pm : $nametoexclude = $recipients->{'changer'} 
|| "";

I temporarily get round the problem by commenting the line 29 in 
Bugzilla/BugMail.pm  : #use strict;
Are you running on Windows or Linux?
Have you made any local modifications to your Bugzilla?
Does this happen any time you submit any change to a bug?

It doesn't seem like that line is capable of producing that error.
Oh, wait, yes, that line is capable of producing that error, if $recipients is
an empty string.
I can't reproduce this on http://landfill.bugzilla.org/bugzilla-2.18-branch/
(In reply to comment #1)
> Are you running on Windows or Linux?
> Have you made any local modifications to your Bugzilla?
> Does this happen any time you submit any change to a bug?
> It doesn't seem like that line is capable of producing that error.

I run Bugzilla on a Debian Linux.
Perl version : 5.8.4 built for i386-linux-thread-multi

This bug happens when I submit a new bug, but not when I add a comment to an 
existing bug or when I change his statut.

I use french templates but I didn't make modifications in Bugzilla other than 
configuration as far as I remember.


I first thought about a regression due to bug 289382, but looking at the code a
bit more, I see nowhere where a string could be passed instead of a hash. Here
is the path to reach BugMail.pm, line 118:

post.bug.cgi -> bug/create/created.html.tmpl -> bug/process/results.html.tmpl ->
bug/process/bugmail.html.tmpl -> Template::SendBugMail() -> BugMail::Send()

Most of the time, such error messages appear when you applied a patch and forgot
to run ./checksetup.pl again. I tried different configurations, all are
successful. Marking WFM.

Moreover, the 2.18 french templates are known to be broken (I heard yesterday
that a 2.18a version of the french templates was expected very soon).
Severity: blocker → normal
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
I confirm, the error is due to the modifications of the templates in the patch 
bugzilla-2.18-to-2.18.3.diff.gz that wasn't affected of course the French 
templates.
Maybe I patched my Bugzilla too fast. I didn't think that this patch may affect 
the templates.

Btw, don't you think that this system of templates is not very convenient for 
an easy and fast inter-nationalization ?
Shouldn't we seperate more efficiently the messages from the code ? I'm 
thinking of one resources file per language.
(In reply to comment #6)
> Shouldn't we seperate more efficiently the messages from the code ? I'm 
> thinking of one resources file per language.

The code is in bugzilla/, templates are in bugzilla/template/. But I see what
you mean; something similar to what Opera does, for instance. There is already a
bug open for this request IIRC.
Status: RESOLVED → VERIFIED
For those who could encounter this error message, note that
template/en/default/bug/create/created.html.tmpl has changed between 2.18.1 and
2.18.3:

line 50: "mailrecipients = item.mailrecipients" has been added.
I've released new versions of the french templates.

bugzilla-fr-2.18a is a new and improved version for 2.18
bugzilla-fr-2.18.1 is for Bugzilla 2.18.1
bugzilla-fr-2.18.2 is for Bugzilla 2.18.2 and 2.18.3 (these two versions share
the same templates).
http://www.bugzilla.org/docs/tip/html/cust-templates.html#template-method says that:

"the contents of this directory [template/en/custom/] will not be touched during
an upgrade, and you can then decide whether to continue using your own
templates, or make the effort to merge your changes into the new versions by hand.

Using this method, your installation may break if incompatible changes are made
to the template interface."

This last sentence is what happened here, see comment 8.
Whiteboard: [READ COMMENTS #8 and #10]
*** Bug 309421 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.