[Bug 29742] New: Make deletemem.pl use Koha::Patron->safe_to_delete
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29742 Bug ID: 29742 Summary: Make deletemem.pl use Koha::Patron->safe_to_delete Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org This method centralizes the validation logic for allowing/denying patron deletion. Should be used instead of having the logic in the controller. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29742 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |jonathan.druart+koha@gmail. | |com, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com Depends on| |29741 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29741 [Bug 29741] Add Koha::Patron->safe_to_delete -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29742 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29742 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 128799 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128799&action=edit Bug 29742: Make deletemem.pl use Koha::Patron->safe_to_delete This patch makes the deletemem.pl controller script reuse the safe_to_delete method introduced by bug 29741. This way, it will use the same logic as the rest of the Koha pieces, like the API. To test: 1. Verify this conditions make deletion be denied: - Has a guarantee - Is the system-defined anonymous patron - Has outstanding debits - Has items checked out 2. Verify that this conditions display relevant information when trying to delete the patron: - Has outstanding credit - Has holds placed - Has pending suggestions 3. Apply this patch 4. Repeat 1 and 2 => SUCCESS: Things didn't change! [*] 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29742 Bug 29742 depends on bug 29741, which changed state. Bug 29741 Summary: Add Koha::Patron->safe_to_delete https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29741 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29742 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |david@davidnind.com --- Comment #2 from David Nind <david@davidnind.com> --- Hi Tomás. After applying the patch (plus a flush_memcached + restart_all) I get this error when deleting a patron with no conditions that should stop the deletion: Operation "eq": no method found, left argument in overloaded package Koha::Result::Boolean, right argument has no overloaded magic at /kohadevbox/koha/members/deletemem.pl line 86 in (eval) at /kohadevbox/koha/members/deletemem.pl line 86 83: 84: my $safe_to_delete = $patron->safe_to_delete; 85: 86: if ( $safe_to_delete eq 'is_anonymous_patron' ) { 87: print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE_ANONYMOUS_PATRON"); 88: exit 0; # Exit without error 89: } in CGI::Compile::ROOT::kohadevbox_koha_members_deletemem_2epl::__ANON__ at /kohadevbox/koha/members/deletemem.pl line 2 1: #!/usr/bin/perl 2: 3: #script to delete items 4: #written 2/5/00 5: #by chris@katipo.co.nz Show function arguments in CGI::Compile::ROOT::kohadevbox_koha_members_deletemem_2epl::deletemem_2epl at /usr/share/perl5/CGI/Compile.pm line 151 148: # this is necessary for MSWin32 149: my $orig_warn = $SIG{__WARN__} || sub { warn(@_) }; 150: local $SIG{__WARN__} = sub { $orig_warn->(@_) unless $_[0] =~ /^No such signal/ }; 151: $code->($self, $data, $path, $dir, \@args) 152: }; 153: }; 154: in CGI::Emulate::PSGI::__ANON__ at /usr/share/perl5/CGI/Emulate/PSGI.pm line 30 27: local *STDOUT = $stdout; 28: local *STDERR = $env->{'psgi.errors'}; 29: 30: $code->(); 31: } 32: } 33: Show function arguments in Plack::App::WrapCGI::call at /usr/share/perl5/Plack/App/WrapCGI.pm line 95 92: 93: sub call { 94: my($self, $env) = @_; 95: $self->_app->($env); 96: } 97: 98: 1; Show function arguments -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org