[Bug 32712] New: OPACShowCheckoutName makes OPAC explode
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Bug ID: 32712 Summary: OPACShowCheckoutName makes OPAC explode Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org When OpacShoeCheckoutName is turned on, the OPAC shows this error if an item is checked out: Template process failed: undef error - The method Koha::Item->firstname is not covered by tests! I had talked to Joubu about it briefly, the fix could be: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc index 0573b90e068..be5dbf004f9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -47,15 +47,16 @@ [% IF datedue %] [% SET itemavailable = 0 %] + [% SET checkout_patron = item.checkout.patron %] [% IF onsite_checkout %] [% IF ( OPACShowCheckoutName ) %] - <span class="item-status checkedout">Currently in local use by [% item.firstname | html %] [% item.surname | html %] [% IF ( item.cardnumber ) %]([% item.cardnumber | html %])[% END %]</span> + <span class="item-status checkedout">Currently in local use by [% checkout_patron.firstname | html %] [% checkout_patron.surname | html %] [% IF ( checkout_patron.cardnumber ) %]([% checkout_patron.cardnumber | html %])[% END %]</span> [% ELSE %] <span class="item-status checkedout">Currently in local use</span> [% END %] [% ELSE %] [% IF ( OPACShowCheckoutName ) %] - <span class="item-status checkedout">Checked out to [% item.firstname | html %] [% item.surname | html %] [% IF ( item.cardnumber ) %]([% item.cardnumber | html %])[% END %]</span> + <span class="item-status checkedout">Checked out to [% checkout_patron.firstname | html %] [% checkout_patron.surname | html %] [% IF ( checkout_patron.cardnumber ) %]([% checkout_patron.cardnumber | html %])[% END %]</span> [% ELSE %] <span class="item-status checkedout">Checked out</span> [% END %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31313 CC| |tomascohen@gmail.com Status|NEW |ASSIGNED Assignee|oleonard@myacpl.org |tomascohen@gmail.com --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Caused by bug 31313 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31313 [Bug 31313] Remove GetItemsInfo from opac-detail -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 145808 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145808&action=edit Bug 32712: Fix OPAC breakage when OPACShowCheckoutName enabled Bug 31313 removed GetItemsInfo and proper Koha::Object-based objects are passed now. But some automatic search & replace kept patron-related attributes incorrectly linked to Koha::Item. This patch makes the item-status.inc file reuse the checkout object and get the linked patron to gather the required information. Some simplification is done on hte same patch... should be trivial. To test: 1. Have OpacShowCheckoutName enabled 2. Pick a biblio with items (all of them not checkecd-out) 3. Open the OPAC detail view for the biblio => SUCCESS: You see the biblio and the items 4. Check one of the items out 5. Refresh the OPAC page => FAIL: The page explodes! 6. Apply this patch 7. Refresh the OPAC page => SUCCESS: You see the biblio and the items, the patron info is correctly displayed. 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145808|0 |1 is obsolete| | --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 145831 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145831&action=edit Bug 32712: Fix OPAC breakage when OPACShowCheckoutName enabled Bug 31313 removed GetItemsInfo and proper Koha::Object-based objects are passed now. But some automatic search & replace kept patron-related attributes incorrectly linked to Koha::Item. This patch makes the item-status.inc file reuse the checkout object and get the linked patron to gather the required information. Some simplification is done on hte same patch... should be trivial. To test: 1. Have OpacShowCheckoutName enabled 2. Pick a biblio with items (all of them not checkecd-out) 3. Open the OPAC detail view for the biblio => SUCCESS: You see the biblio and the items 4. Check one of the items out 5. Refresh the OPAC page => FAIL: The page explodes! 6. Apply this patch 7. Refresh the OPAC page => SUCCESS: You see the biblio and the items, the patron info is correctly displayed. 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145831|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 145832 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145832&action=edit Bug 32712: Fix OPAC breakage when OPACShowCheckoutName enabled Bug 31313 removed GetItemsInfo and proper Koha::Object-based objects are passed now. But some automatic search & replace kept patron-related attributes incorrectly linked to Koha::Item. This patch makes the item-status.inc file reuse the checkout object and get the linked patron to gather the required information. Some simplification is done on hte same patch... should be trivial. To test: 1. Have OpacShowCheckoutName enabled 2. Pick a biblio with items (all of them not checkecd-out) 3. Open the OPAC detail view for the biblio => SUCCESS: You see the biblio and the items 4. Check one of the items out 5. Refresh the OPAC page => FAIL: The page explodes! 6. Apply this patch 7. Refresh the OPAC page => SUCCESS: You see the biblio and the items, the patron info is correctly displayed. 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_22_11_candidate CC| |jonathan.druart+koha@gmail. | |com, | |lucas@bywatersolutions.com Severity|major |critical -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145832|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 145840 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145840&action=edit Bug 32712: Fix OPAC breakage when OPACShowCheckoutName enabled Bug 31313 removed GetItemsInfo and proper Koha::Object-based objects are passed now. But some automatic search & replace kept patron-related attributes incorrectly linked to Koha::Item. This patch makes the item-status.inc file reuse the checkout object and get the linked patron to gather the required information. Some simplification is done on hte same patch... should be trivial. To test: 1. Have OpacShowCheckoutName enabled 2. Pick a biblio with items (all of them not checkecd-out) 3. Open the OPAC detail view for the biblio => SUCCESS: You see the biblio and the items 4. Check one of the items out 5. Refresh the OPAC page => FAIL: The page explodes! 6. Apply this patch 7. Refresh the OPAC page => SUCCESS: You see the biblio and the items, the patron info is correctly displayed. 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145840|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 145841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145841&action=edit Bug 32712: Fix OPAC breakage when OPACShowCheckoutName enabled Bug 31313 removed GetItemsInfo and proper Koha::Object-based objects are passed now. But some automatic search & replace kept patron-related attributes incorrectly linked to Koha::Item. This patch makes the item-status.inc file reuse the checkout object and get the linked patron to gather the required information. Some simplification is done on hte same patch... should be trivial. To test: 1. Have OpacShowCheckoutName enabled 2. Pick a biblio with items (all of them not checkecd-out) 3. Open the OPAC detail view for the biblio => SUCCESS: You see the biblio and the items 4. Check one of the items out 5. Refresh the OPAC page => FAIL: The page explodes! 6. Apply this patch 7. Refresh the OPAC page => SUCCESS: You see the biblio and the items, the patron info is correctly displayed. 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Thanks, Tomas, better than mine. I would have been tempted to use Koha.Preference for OPACShowCheckoutName, but that's for another day ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Worth noting: the only difference would be (theorically) if we have a checkout without due date, which does not make sense. By the way, shouldn't we have it not null in DB structure? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #7)
I would have been tempted to use Koha.Preference for OPACShowCheckoutName, but that's for another day ;)
Yeah, it just needs tweaking several .pl and felt out of the scope. (In reply to Jonathan Druart from comment #8)
Worth noting: the only difference would be (theorically) if we have a checkout without due date, which does not make sense.
We should (at some point) allow 'indefinite checkouts'. I felt like we should be prepared for due_date=NULL for the future. Anyway, as you also noticed, we are not setting due_date=NULL so the behavior is kept. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 145847 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145847&action=edit Bug 32712: (QA follow-up) Use Koha.Preference Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.05.00 |23.05.00,22.11.03 released in| | Status|Pushed to master |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #12 from Jacob O'Mara <jacob.omara@ptfs-europe.com> --- Nice work, thanks everyone! Pushed to 22.11.x for the next release. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #10)
Created attachment 145847 [details] [review] Bug 32712: (QA follow-up) Use Koha.Preference
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc is missing [% USE Koha %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #13)
(In reply to Tomás Cohen Arazi from comment #10)
Created attachment 145847 [details] [review] [review] Bug 32712: (QA follow-up) Use Koha.Preference
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc is missing [% USE Koha %]
That was on purpose. Do you think it needs to be added even if the callers already include it? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #15 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- It should be included where used. We faced issues because of that in the past (w hen backported for instance). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 146014 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146014&action=edit Bug 32712: (QA follow-up) Add missing include I assumed it wasn't needed because teh .tt files using this already includ teh Koha plugin. But we shuoldn't skip, just in case someone doesn't notice when reusing this, and debugging will be a pain. Sorry for that. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to stable |RESOLVED --- Comment #17 from Lucas Gass <lucas@bywatersolutions.com> --- Not needed in 22.05.x, no backport -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32712 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed, | |rel_22_11_candidate | CC| |martin.renvoize@ptfs-europe | |.com --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- All in 22.11.x already. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org