Bug 21025 - Koha::Patron::Discharge is missing use C4::Letters
Summary: Koha::Patron::Discharge is missing use C4::Letters
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Charles Farmer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-29 20:03 UTC by Charles Farmer
Modified: 2019-10-14 19:57 UTC (History)
7 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
Bug21025: Add GetPreparedLetter to Koha::Patron::Discharge (1.70 KB, patch)
2018-06-29 20:22 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 21025: Add GetPreparedLetter to Koha::Patron::Discharge (1.76 KB, patch)
2018-07-08 15:14 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21025: Add GetPreparedLetter to Koha::Patron::Discharge (1.83 KB, patch)
2018-07-12 17:38 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Farmer 2018-06-29 20:03:38 UTC
Tried to download a discharge slip from the OPAC, but received the following message:

> An error occurs when generating the pdf file. Please contact the staff to resolve this problem.

From the logs:

> [Fri Jun 29 15:34:45.758105 2018] [cgi:error] [pid 10573] [client 127.0.0.1:44946] AH01215: [Fri Jun 29 15:34:45 2018] opac-discharge.pl: Undefined subroutine &C4::Letters::GetPreparedLetter called at /meow/Koha/Patron/Discharge.pm line 113.: /meow/opac/opac-discharge.pl, referer: http://master/cgi-bin/koha/opac-discharge.pl

Will submit patch.
Comment 1 Charles Farmer 2018-06-29 20:22:51 UTC
Created attachment 76588 [details] [review]
Bug21025: Add GetPreparedLetter to Koha::Patron::Discharge

Test plan (shamelessly ripped from Bug20953):

1) Set system preference 'useDischarge' to 'Allow'
2) Choose a patron without checkouts nor fines nor restrictions
3) Log at OPAC and go to patron page /cgi-bin/koha/opac-user.pl
4) Click on 'ask for a discharge' tab
   => You see /cgi-bin/koha/opac-discharge.pl
      with text 'What is a discharge? ...'
5) Click on 'Ask for a discharge' link
   => You see /cgi-bin/koha/opac-discharge.pl?op=request
      with text 'Your discharge request has been sent ...'
6) In a new browser tab/page, go to intranet on /cgi-bin/koha/members/discharges.pl
   => You see one discharge requets for the patron
   => Click on 'allow' on patron discharge request
7) Come back to OPAC and refresh /cgi-bin/koha/opac-discharge.pl
  => You see link 'Get your discharge'
8) Click on the link to get your generated PDF
  => An error message should appear informing you to contact your website's admin
9) Apply this patch
10) Click again on the link to get your generated PDF
  => This time, a download prompt should appear
Comment 2 Katrin Fischer 2018-07-08 15:13:45 UTC
Can't reproduce the problem, but we have seen similar recently and this will not hurt. Please don't forget to assign bugs to yourself when providing or planning to provide a patch!
Comment 3 Katrin Fischer 2018-07-08 15:14:11 UTC
Created attachment 76761 [details] [review]
Bug 21025: Add GetPreparedLetter to Koha::Patron::Discharge

Test plan (shamelessly ripped from Bug20953):

1) Set system preference 'useDischarge' to 'Allow'
2) Choose a patron without checkouts nor fines nor restrictions
3) Log at OPAC and go to patron page /cgi-bin/koha/opac-user.pl
4) Click on 'ask for a discharge' tab
   => You see /cgi-bin/koha/opac-discharge.pl
      with text 'What is a discharge? ...'
5) Click on 'Ask for a discharge' link
   => You see /cgi-bin/koha/opac-discharge.pl?op=request
      with text 'Your discharge request has been sent ...'
6) In a new browser tab/page, go to intranet on /cgi-bin/koha/members/discharges.pl
   => You see one discharge requets for the patron
   => Click on 'allow' on patron discharge request
7) Come back to OPAC and refresh /cgi-bin/koha/opac-discharge.pl
  => You see link 'Get your discharge'
8) Click on the link to get your generated PDF
  => An error message should appear informing you to contact your website's admin
9) Apply this patch
10) Click again on the link to get your generated PDF
  => This time, a download prompt should appear

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2018-07-12 17:38:17 UTC
Created attachment 76897 [details] [review]
Bug 21025: Add GetPreparedLetter to Koha::Patron::Discharge

Test plan (shamelessly ripped from Bug20953):

1) Set system preference 'useDischarge' to 'Allow'
2) Choose a patron without checkouts nor fines nor restrictions
3) Log at OPAC and go to patron page /cgi-bin/koha/opac-user.pl
4) Click on 'ask for a discharge' tab
   => You see /cgi-bin/koha/opac-discharge.pl
      with text 'What is a discharge? ...'
5) Click on 'Ask for a discharge' link
   => You see /cgi-bin/koha/opac-discharge.pl?op=request
      with text 'Your discharge request has been sent ...'
6) In a new browser tab/page, go to intranet on /cgi-bin/koha/members/discharges.pl
   => You see one discharge requets for the patron
   => Click on 'allow' on patron discharge request
7) Come back to OPAC and refresh /cgi-bin/koha/opac-discharge.pl
  => You see link 'Get your discharge'
8) Click on the link to get your generated PDF
  => An error message should appear informing you to contact your website's admin
9) Apply this patch
10) Click again on the link to get your generated PDF
  => This time, a download prompt should appear

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Nick Clemens 2018-07-13 13:50:32 UTC
Awesome work all!

Pushed to master for 18.11
Comment 6 Martin Renvoize 2018-07-15 19:23:54 UTC
Pushed to 18.05.x for 18.05.02
Comment 7 Fridolin Somers 2018-07-30 13:45:03 UTC
Pushed to 17.11.x for 17.11.09