Bug 14910 - Renew a patron does not redirect to the correct module
Summary: Renew a patron does not redirect to the correct module
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 14691 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-28 10:01 UTC by Jonathan Druart
Modified: 2016-06-21 21:38 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 14910: Redirect to the circulation module after a renew (7.22 KB, patch)
2015-09-28 10:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
[Signed-off] Bug 14910: Redirect to the circulation module after a renew (7.41 KB, patch)
2015-09-28 17:14 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14910: Redirect to the circulation module after a renew (7.06 KB, patch)
2015-10-01 09:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14910: Redirect to the circulation module after a renew (7.25 KB, patch)
2015-10-01 12:05 UTC, Magnus Enger
Details | Diff | Splinter Review
[PASSED QA] Bug 14910: Redirect to the circulation module after a renew (7.32 KB, patch)
2015-10-01 20:57 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 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&cardnumber=rm'me&desintation=circ&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.