Bug 14910

Summary: Renew a patron does not redirect to the correct module
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: chris, gmcharlt, gwilliams, katrin.fischer, kyle.m.hall, liz, magnus, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14691
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 14910: Redirect to the circulation module after a renew
[Signed-off] Bug 14910: Redirect to the circulation module after a renew
Bug 14910: Redirect to the circulation module after a renew
Bug 14910: Redirect to the circulation module after a renew
[PASSED QA] Bug 14910: Redirect to the circulation module after a renew

Description Jonathan Druart 2015-09-28 10:01:48 UTC
If a patron is renewed from the circulation module, the librarian should be redirected to the circulation module.
This works correctly if the renew is done from the patron module (members).

This is caused by a typo in the template: desintation vs destination
Comment 1 Jonathan Druart 2015-09-28 10:13:53 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-09-28 17:14:43 UTC Comment hidden (obsolete)
Comment 3 HB-NEKLS 2015-09-28 20:46:30 UTC
*** Bug 14691 has been marked as a duplicate of this bug. ***
Comment 4 Katrin Fischer 2015-09-29 21:59:18 UTC
I think there is a bug hiding in this patch - I try renewing a patron from the sample database: 

localhost:8080/cgi-bin/koha/members/moremember.pl?borrowernumber=41
Gloria Odom (23529000054503)

it works ok without this patch, but with the patch I get redirected to:
http://localhost:8080/cgi-bin/koha/members/moremember.pl?41&was_renewed=1
With the message: This patron does not exist. 
Looks like we are missing the borrowernumber part in the URL?
Comment 5 Jonathan Druart 2015-10-01 09:48:03 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-10-01 09:48:23 UTC
(In reply to Katrin Fischer from comment #4)
> I think there is a bug hiding in this patch - I try renewing a patron from
> the sample database: 
> 
> localhost:8080/cgi-bin/koha/members/moremember.pl?borrowernumber=41
> Gloria Odom (23529000054503)
> 
> it works ok without this patch, but with the patch I get redirected to:
> http://localhost:8080/cgi-bin/koha/members/moremember.pl?41&was_renewed=1
> With the message: This patron does not exist. 
> Looks like we are missing the borrowernumber part in the URL?

Erk, last minute change! Thanks for catching that!
Comment 7 Magnus Enger 2015-10-01 10:31:50 UTC
(In reply to Jonathan Druart from comment #5)
> Test plan:
> 0/ Do not apply this patch
> 1/ Create a patron with a cardnumber with a quote (rm'me) and another
> one without a quote (rmme)
> 2/ Go on the checkouts page (circ/circulation.pl)
> 3/ Renew the 2 patrons
> => With rm'me you are redirected to the circ module - ok
> => With rmme you are redirected to the member module - nok

I can reproduce this without the patch. 

But after I apply the patch, I get this: 

rm'me: No JS popup confirmation, but redirected to the circ module
rmme: JS popup confirmation, but redirected to the member module

For rmme I get this error in the Firebug Console: 

    SyntaxError: expected expression, got ','
    firstDay: ,

For rm'me I get two errors:

    SyntaxError: expected expression, got ','
    firstDay: ,

    SyntaxError: missing ; before statement
    ...owernumber=6450&amp;cardnumber=rm'me&amp;desintation=circ&amp;reregistration=y'
Comment 8 Jonathan Druart 2015-10-01 11:11:25 UTC
Magnus, could you confirm you have correctly cleared your browser cache?
Comment 9 Magnus Enger 2015-10-01 11:39:42 UTC
(In reply to Jonathan Druart from comment #8)
> Magnus, could you confirm you have correctly cleared your browser cache?

Ah, not necessarily. I'll have another go.
Comment 10 Magnus Enger 2015-10-01 12:05:01 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2015-10-01 20:57:33 UTC
Created attachment 43032 [details] [review]
[PASSED QA] Bug 14910: Redirect to the circulation module after a renew

iIf a patron is renewed from the circulation module, the librarian
should be redirected to the circulation module.
This works correctly if the renew is done from the patron module
(members).

This is caused by a typo in the template: desintation vs destination.

This patch also removes the cardnumber parameter to the setstatus.pl
script, it is not needed given that borrowernumber is always passed.

This has a good side-effect, it will fix bug 14691. The cardnumber does
not exist anymore, so no need to escape it :)

Test plan:
0/ Do not apply this patch
1/ Create a patron with a cardnumber with a quote (rm'me) and another
one without a quote (rmme)
2/ Go on the checkouts page (circ/circulation.pl)
3/ Renew the 2 patrons
=> With rm'me you are redirected to the circ module - ok
=> With rmme you are redirected to the member module - nok
4/ Go on the patron detail page (members/moremember.pl)
5/ Renew the 2 patrons
=> you are redirected to the member module - ok
6/ Delete the patrons
=> Nothing happend with rm'me, there is a JS error on the page - nok
=> rmme is deleted - ok

7/ Apply the patch and recreate rmme
8/ Repeat 2, 3, 4, 5
=> You are redirected to the correct module
9/ Delete the patrons
=> They are successfully deleted

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan, works as advertised. (I did have some problems
initially, but that was caused by me not using the interface in
English...)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Tomás Cohen Arazi 2015-10-02 17:37:32 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 13 Chris Cormack 2015-10-23 07:53:47 UTC
Pushed to 3.20.x will be in 3.20.5
Comment 14 Liz Rea 2015-11-02 21:03:10 UTC
Pushed to 3.18.x, is in 3.18.12.