Bug 26915 - Koha explodes when writing off a fee with FinePaymentAutoPopup
Summary: Koha explodes when writing off a fee with FinePaymentAutoPopup
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 23051 23507
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-03 21:04 UTC by Katrin Fischer
Modified: 2021-06-14 21:29 UTC (History)
4 users (show)

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


Attachments
Bug 26915: Fix FinePaymentAutoPopup behaviour (1.33 KB, patch)
2020-11-04 08:06 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26915: Fix FinePaymentAutoPopup behaviour (1.38 KB, patch)
2020-11-04 09:28 UTC, David Nind
Details | Diff | Splinter Review
Bug 26915: Fix FinePaymentAutoPopup behaviour (1.44 KB, patch)
2020-11-05 11:52 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2020-11-03 21:04:20 UTC
- To test activate FinePaymentAutoPopup
- Create a manual fee
- Write it off using the write off button on the account line (not below table)
- Experience error on saving the writeoff

http://localhost:8081/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=HASH(0x558152468290)&borrowernumber=51

Can't call method "unblessed" on an undefined value at /home/vagrant/kohaclone/members/printfeercpt.pl line 64

This problem was first found in 20.05.03 so affects stable releases as well!
Comment 1 Jonathan Druart 2020-11-04 08:02:31 UTC
Caused by
  commit a2449a81be55aa5b3710ca2c6df7884513f89540
  Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test

Which modified the return value of Koha::Account->pay
Comment 2 Jonathan Druart 2020-11-04 08:06:38 UTC
Created attachment 112974 [details] [review]
Bug 26915: Fix FinePaymentAutoPopup behaviour

The behaviour of the syspref FinePaymentAutoPopup is broken, the popup
explodes with
    Can't call method "unblessed" on an undefined value at /home/vagrant/kohaclone/members/printfeercpt.pl line 64

It has been broken by
  commit a2449a81be55aa5b3710ca2c6df7884513f89540
  Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test
which modified the return value of Koha::Account->pay (from $payment_id
to a hashref)

Test plan:
- To test activate FinePaymentAutoPopup
- Create a manual fee
- Write it off using the write off button on the account line (not below table)
=> Without the patch you get the error
=> With the patch applied the popup is correctly displayed
Comment 3 David Nind 2020-11-04 09:28:06 UTC
Created attachment 112978 [details] [review]
Bug 26915: Fix FinePaymentAutoPopup behaviour

The behaviour of the syspref FinePaymentAutoPopup is broken, the popup
explodes with
    Can't call method "unblessed" on an undefined value at /home/vagrant/kohaclone/members/printfeercpt.pl line 64

It has been broken by
  commit a2449a81be55aa5b3710ca2c6df7884513f89540
  Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test
which modified the return value of Koha::Account->pay (from $payment_id
to a hashref)

Test plan:
- To test activate FinePaymentAutoPopup
- Create a manual fee
- Write it off using the write off button on the account line (not below table)
=> Without the patch you get the error
=> With the patch applied the popup is correctly displayed

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Martin Renvoize 2020-11-05 11:52:06 UTC
Created attachment 113095 [details] [review]
Bug 26915: Fix FinePaymentAutoPopup behaviour

The behaviour of the syspref FinePaymentAutoPopup is broken, the popup
explodes with
    Can't call method "unblessed" on an undefined value at /home/vagrant/kohaclone/members/printfeercpt.pl line 64

It has been broken by
  commit a2449a81be55aa5b3710ca2c6df7884513f89540
  Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test
which modified the return value of Koha::Account->pay (from $payment_id
to a hashref)

Test plan:
- To test activate FinePaymentAutoPopup
- Create a manual fee
- Write it off using the write off button on the account line (not below table)
=> Without the patch you get the error
=> With the patch applied the popup is correctly displayed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2020-11-05 11:52:54 UTC
You beat me to this one Jonathan, thanks! :).

I've grepped around to see if there are any other cases and can't spot any.

Fix works as expected, no regressions.

Passing QA
Comment 6 Jonathan Druart 2020-11-05 14:25:45 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 7 Lucas Gass 2020-11-16 21:47:16 UTC
backported to 20.05.x for 20.05.06
Comment 8 Aleisha Amohia 2020-11-17 05:31:25 UTC
missing dependencies, not backported to 19.11.x