Bug 15462 - Unable to renew books via circ/renew.pl
Summary: Unable to renew books via circ/renew.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 13790 14978
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-04 18:13 UTC by Chad Billman
Modified: 2019-06-27 09:24 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15462 - Unable to renew books via circ/renew.pl (898 bytes, patch)
2016-01-05 08:19 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15462 - Unable to renew books via circ/renew.pl (966 bytes, patch)
2016-01-05 08:43 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 15462 - Unable to renew books via circ/renew.pl (1.01 KB, patch)
2016-01-06 19:58 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chad Billman 2016-01-04 18:13:33 UTC
Renewing books from circ/renew.pl produces an internal server error with the following entry in the logs:

("Can't locate object method \"single\" via package \"5\" (perhaps "...) called at /var/koha/circ/renew.pl line 57


mveron confirmed this impacts the master branch as well.
Comment 1 Jonathan Druart 2016-01-05 08:02:22 UTC
This is critical.
It looks like a bad side effect of bug 13790. Still investigating...
Comment 2 Marc Véron 2016-01-05 08:14:09 UTC
Found soultion, patch follows.
Comment 3 Marc Véron 2016-01-05 08:19:23 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2016-01-05 08:40:23 UTC
For the record, it has been introduced by 

commit 3cab4d1efd25268441c88ce74d5a4b568773c8aa
Bug 14978: (RM followup) DBIx update

Bug 14978 introduced a unique on items.itemnumber to get the constraint we had before bug 13790.

With adding this constraint, DBIx::Class::Schema::Loader renamed the has_many issues RS with a might_have issue.

+__PACKAGE__->might_have(
+  "issue",
-__PACKAGE__->has_many(
-  "issues",
Comment 5 Jonathan Druart 2016-01-05 08:43:13 UTC Comment hidden (obsolete)
Comment 6 Chad Billman 2016-01-05 13:04:03 UTC
This patch fixed it.

Thank you!
Comment 7 Katrin Fischer 2016-01-06 19:58:38 UTC
Created attachment 46346 [details] [review]
[PASSED QA] Bug 15462 - Unable to renew books via circ/renew.pl

To verify: Got to circ/circulation.pl and try to renew an item.
Result: Can't call method "single" without a package or
        object reference at /usr/share/kohaclone/circ/renew.pl
        line 57

To test:
- Apply patch
- Try to renew items that are or are not checked out. Error
  no longer occurs.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Brendan Gallagher 2016-01-07 18:28:05 UTC
Pushed to master - Thanks.
Comment 9 Julian Maurice 2016-01-12 13:09:21 UTC
Patch pushed to 3.22.x, will be in 3.22.2
Comment 10 Frédéric Demians 2016-01-25 16:25:55 UTC
This patch has been pushed to 3.20.x, will be in 3.20.8.