Bug 8788 - Viewing basket for acquisitions triggers error log entries.
Summary: Viewing basket for acquisitions triggers error log entries.
Status: RESOLVED DUPLICATE of bug 5335
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: M. Tompsett
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-19 08:35 UTC by M. Tompsett
Modified: 2012-09-21 15:33 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Added conditional secondary template param call (3.6.x) (1.95 KB, patch)
2012-09-19 11:03 UTC, M. Tompsett
Details | Diff | Splinter Review
Added conditional secondary template param call (1.83 KB, patch)
2012-09-19 11:05 UTC, M. Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description M. Tompsett 2012-09-19 08:35:11 UTC
[Wed Sep 19 14:38:07 2012] [error] [client 192.168.100.2] [Wed Sep 19 14:38:07 2012] basket.pl: Use of uninitialized value $total_est_gste in sprintf at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 370., referer: https://.../cgi-bin/koha/acqui/booksellers.pl
[Wed Sep 19 14:38:07 2012] [error] [client 192.168.100.2] [Wed Sep 19 14:38:07 2012] basket.pl: Use of uninitialized value $total_est_gste in sprintf at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 370., referer: https://.../cgi-bin/koha/acqui/booksellers.pl
[Wed Sep 19 14:38:07 2012] [error] [client 192.168.100.2] [Wed Sep 19 14:38:07 2012] basket.pl: Use of uninitialized value $gist_est in sprintf at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 370., referer: https://.../cgi-bin/koha/acqui/booksellers.pl
[Wed Sep 19 14:38:07 2012] [error] [client 192.168.100.2] [Wed Sep 19 14:38:07 2012] basket.pl: Use of uninitialized value $gist_est in sprintf at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 370., referer: https://.../cgi-bin/koha/acqui/booksellers.pl
[Wed Sep 19 14:38:42 2012] [error] [client 192.168.100.2] [Wed Sep 19 14:38:42 2012] basket.pl: Use of uninitialized value $total_est_gste in sprintf at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 370., referer: https://.../cgi-bin/koha/acqui/booksellers.pl
[Wed Sep 19 14:38:42 2012] [error] [client 192.168.100.2] [Wed Sep 19 14:38:42 2012] basket.pl: Use of uninitialized value $total_est_gste in sprintf at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 370., referer: https://.../cgi-bin/koha/acqui/booksellers.pl
[Wed Sep 19 14:38:42 2012] [error] [client 192.168.100.2] [Wed Sep 19 14:38:42 2012] basket.pl: Use of uninitialized value $gist_est in sprintf at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 370., referer: https://.../cgi-bin/koha/acqui/booksellers.pl
[Wed Sep 19 14:38:42 2012] [error] [client 192.168.100.2] [Wed Sep 19 14:38:42 2012] basket.pl: Use of uninitialized value $gist_est in sprintf at /usr/share/koha/intranet/cgi-bin/acqui/basket.pl line 370., referer: https://.../cgi-bin/koha/acqui/booksellers.pl


Looking at the template file: total_rrp_gste, total_est_gste, gist_rate, gist_rrp, and gist_est are only used if GST (which is $gist) is set.

The solution I took was to move these variables to a separate $template->param() call based on "if $gist;".

I found this bug in 3.6.3, it exists in 3.8.4 too.
Comment 1 M. Tompsett 2012-09-19 11:03:58 UTC
Created attachment 12338 [details] [review]
Added conditional secondary template param call (3.6.x)

Testing
--------
Set gist=0 (it's a system preference: home->administration->search for gist preference, it's the one about the default tax rate)
Login
Acquisitions (already had $100 in available funds)
Search for vendor (already had "Book Trends" added)
View (already had a "basket" added)
*BAM*
/var/log/koha/... (the intranet error log file) has errors.
apply patch
Home
Acquisitions
Search for vendor (used "Book Trends" again)
View (the existing basket of course)
Check /var/log/koha/... (intranet error log) and there are no new errors.
Set gist>0
retest to make sure both if $gist and if !$gist work.
Set gist back to what you want it. :)

The 3.6.x seemed to need a different patch than master. applies to 3.6.x, 3.8.x, and master
Comment 2 M. Tompsett 2012-09-19 11:05:10 UTC
Created attachment 12339 [details] [review]
Added conditional secondary template param call

This should applied to 3.8.x and master. See testing plan above.
Comment 3 M. Tompsett 2012-09-21 15:33:48 UTC
It would seem that bug 5335 has made this bug report irrelevant, except for the test case provided. If no errors occur, then all should be fine. I'm marking it as a duplicate of 5335, even though 5335 is far bigger in scope than this tiny change. It's side-effect cleaned up this problem.

*** This bug has been marked as a duplicate of bug 5335 ***