Bug 16378

Summary: Overdues.pm: Can't call method "store" without a package or object reference
Product: Koha Reporter: Marc Véron <veron>
Component: CirculationAssignee: Jacek Ablewicz <abl>
Status: CLOSED FIXED QA Contact: Kyle M Hall <kyle.m.hall>
Severity: blocker    
Priority: P5 - low CC: abl, brendan, gmcharlt, julian.maurice, kyle.m.hall, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15675
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 15675    
Bug Blocks:    
Attachments: Bug 16378: Overdues.pm: Can't call method "store" without a package or object reference
Bug 16378: Overdues.pm: Can't call method "store" without a package or object reference
Bug 16378: Overdues.pm: Can't call method "store" without a package or object reference

Description Marc Véron 2016-04-28 08:43:48 UTC
To reproduce:

- Go to cgi-bin/koha/circ/returns.pl (Home > Circulation > Check in)
- Enter 2, hit Submit
=> Result: Check in message: No item with barcode 2
Nothing in intranet-error.log

- Enter 1, hit Submit
=> Result: An error has occurred! Error 500
Intranet-error.log:
returns.pl: No property outstanding! at /usr/share/kohaclone/Koha/Object.pm line 188
...and about 10 more lines
Comment 1 Marc Véron 2016-04-28 09:27:48 UTC
Ok, it's not related to the barcode 1.

I had an item with barcode 1. Changed the barcode to 111.
It is checked out to patron A.
Returnig leads to the error as in comment above.

Trying to check out to a patron B leads to:
Software error
Can't call method "store" without a package or object reference at /usr/share/kohaclone/C4/Overdues.pm line 584.
Comment 2 Marc Véron 2016-04-28 09:49:36 UTC
Found:
Overdues.pm line 588 tries to do an $accountline->set with column outstanding instead of amountoutstanding.

Patch follows.
Comment 3 Marc Véron 2016-04-28 09:55:54 UTC Comment hidden (obsolete)
Comment 4 Jacek Ablewicz 2016-04-28 10:32:48 UTC Comment hidden (obsolete)
Comment 5 Jacek Ablewicz 2016-04-28 10:42:49 UTC
This bug can be triggered as well when trying to run misc/cronjobs/fines.pl (on some database with overdued items):

No property outstanding! at /home/koha/devkohaclone/C4/Overdues.pm line 584
Can't call method "store" without a package or object reference at /home/koha/devkohaclone/C4/Overdues.pm line 584.

Without the patch, fine calculations are pretty much completely broken, overdued items are unreturnable and so on. Upping severity to 'blocker'.
Comment 6 Kyle M Hall 2016-04-28 12:14:03 UTC
Created attachment 50905 [details] [review]
Bug 16378: Overdues.pm: Can't call method "store" without a package or object reference

Overdues.pm line 588 tries to do an $accountline->set with column outstanding
instead of amountoutstanding.
This patch fixes it.

To test:
- Verify that code change is correct.
- Try to trigger a situation where an existing fine is updated
  (see comment in line 574 in C4/Overdues.pm)

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Brendan Gallagher 2016-04-28 23:24:14 UTC
Pushed to Master - Should be in the May 2016 Release.  Thanks!
Comment 8 Julian Maurice 2016-05-09 08:09:49 UTC
Not needed in stable versions, status changed to RESOLVED