[Koha-bugs] [Bug 7630] Warning on moremember.pl about param without key
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Jun 5 05:34:12 CEST 2012
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7630
M. Tompsett <mtompset at hotmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mtompset at hotmail.com
Severity|enhancement |minor
--- Comment #1 from M. Tompsett <mtompset at hotmail.com> ---
This is similar to bug 7352. However, I don't believe patron quick search is
memberentry.pl
I was going to enter something similar, but since I think that would be a
duplicate of this problem, I'll add this commentary with my debugging hunt.
C4::Template generated the following error log entry:
[Mon Jun 04 11:50:36 2012] [error] [client 192.168.100.2] [Mon Jun 4 11:50:36
2012] moremember.pl: Problem = a value of 1 has been passed to param without
key at /usr/share/koha/lib/C4/Templates.pm line 186., referer:
https://.../cgi-bin/koha/members/memberentry.pl
So I looked around line 186 of C4::Templates.pm
if ( $key ) {
$self->{VARS}->{$key} = $val;
} else {
warn "Problem = a value of $val has been passed to param without
key";
}
So I figured that moremember.pl must have $template->param( ... => 1 ...
Line 145 in moremember.pl looked like a candidate, but I figured not. $_ would
have some value most likely. I kept looking (/\$template->param). I skipped a
few lines which had concatenations, because I was hoping they'd be initialized
and not be the problem. That's when I found line 445 which has a number of
parameters across many lines. One of them was $error (around line 466).
$error => 1,
I then decided to search for $error backwards (?\$error). That's when I saw the
code of line 74:
my $error = $input->param('error');
I then looked at memberentry.pl the only set of lines with moremember.pl
mentioned are:
$input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber")
:
$input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber")
;
exit; # You can only send 1 redirect! After that, content or
other headers don't matter.
-- If someone noticed this before, why is it here?
Also, notice there is no "&error=..." as well, so this isn't passing a value to
$error.
I figure that something similar to bug 6840 can be done in moremember.pl
Split the $template->param() call:
-- original
++ tweak
$template->param(
detailview => 1,
AllowRenewalLimitOverride =>
C4::Context->preference("AllowRenewalLimitOverride"),
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
CANDELETEUSER => $candeleteuser,
roaddetails => $roaddetails,
borrowernumber => $borrowernumber,
othernames => $data->{'othernames'},
categoryname => $data->{'description'},
reregistration => $reregistration,
branch => $branch,
todaysdate => C4::Dates->today(),
totalprice => sprintf("%.2f", $totalprice),
totaldue => sprintf("%.2f", $total),
totaldue_raw => $total,
issueloop => @issuedata,
relissueloop => @relissuedata,
issuecount => $issuecount,
relissuecount => $relissuecount,
overdues_exist => $overdues_exist,
- error => $error,
- $error => 1,
StaffMember => ($category_type eq 'S'),
is_child => ($category_type eq 'C'),
# reserveloop => \@reservedata,
dateformat => C4::Context->preference("dateformat"),
"dateformat_" . (C4::Context->preference("dateformat") || '') => 1,
samebranch => $samebranch,
quickslip => $quickslip,
);
++$template->param(error => $error, $error => 1) if $error;
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list