Bugzilla – Attachment 56057 Details for
Bug 17403
Internal Server Error while deleting patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17403: Internal Server Error while deleting patron
Bug-17403-Internal-Server-Error-while-deleting-pat.patch (text/plain), 2.78 KB, created by
Marc Véron
on 2016-10-05 14:40:36 UTC
(
hide
)
Description:
Bug 17403: Internal Server Error while deleting patron
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-10-05 14:40:36 UTC
Size:
2.78 KB
patch
obsolete
>From 76810c2b5efbd763bf0e2c1b210bed19e9f8d329 Mon Sep 17 00:00:00 2001 >From: Marc <veron@veron.ch> >Date: Wed, 5 Oct 2016 15:43:29 +0200 >Subject: [PATCH] Bug 17403: Internal Server Error while deleting patron > >This patch fixes a Internal Server Error while deleting patrons. > >To reproduce: > >- Go to a patron's detail page >- Toolbar : More : Delete >- Confirm "Are you sure you want to delete..." > >Result: Internal Server Error >Plack error log: >exited nonzero: 1 at /home/marc/koha/members/deletemem.pl >Note: Patron is deleted > >Additional tests: Try to delete yourself, to delete a staff member >without having superlibrarian permission etc. > >To test: > >- Apply patch >- Re-start plack >- Try to reproduce steps above (with other patron) >Expected result: >No Internal Server Error, Redirect to Home > Patrons > >Amended to include all occurences of 'exit 1' >--- > members/deletemem.pl | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/members/deletemem.pl b/members/deletemem.pl >index 60de8c0..1f901e5 100755 >--- a/members/deletemem.pl >+++ b/members/deletemem.pl >@@ -55,7 +55,7 @@ my $member = $input->param('member'); > #Do not delete yourself... > if ($borrowernumber == $member ) { > print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE_YOURSELF"); >- exit 1; >+ exit 0; # Exit without error > } > > # Handle deletion from the Norwegian national patron database, if it is enabled >@@ -84,12 +84,12 @@ my $userenv = C4::Context->userenv; > if ($bor->{category_type} eq "S") { > unless(C4::Auth::haspermission($userenv->{'id'},{'staffaccess'=>1})) { > print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE_STAFF"); >- exit 1; >+ exit 0; # Exit without error > } > } else { > unless(C4::Auth::haspermission($userenv->{'id'},{'borrowers'=>1})) { > print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE"); >- exit 1; >+ exit 0; # Exit without error > } > } > >@@ -98,7 +98,7 @@ if (C4::Context->preference("IndependentBranches")) { > if ( !C4::Context->IsSuperLibrarian() && $bor->{'branchcode'}){ > unless ($userenv->{branch} eq $bor->{'branchcode'}){ > print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE_OTHERLIBRARY"); >- exit; >+ exit 0; # Exit without error > } > } > } >@@ -165,7 +165,7 @@ if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_ > DelMember($member); > # TODO Tell the user everything went ok > print $input->redirect("/cgi-bin/koha/members/members-home.pl"); >- exit 1; >+ exit 0; # Exit without error > } > > output_html_with_http_headers $input, $cookie, $template->output; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17403
:
56055
|
56057
|
56067
|
56186