Bugzilla – Attachment 188561 Details for
Bug 41131
Branch Transfer Limits basic editor allows one to prevent transfers from a library to itself and block related holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41131: Don't allow limiting transfers from/to a single branch
Bug-41131-Dont-allow-limiting-transfers-fromto-a-s.patch (text/plain), 3.74 KB, created by
Nick Clemens (kidclamp)
on 2025-10-29 15:27:16 UTC
(
hide
)
Description:
Bug 41131: Don't allow limiting transfers from/to a single branch
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-10-29 15:27:16 UTC
Size:
3.74 KB
patch
obsolete
>From 68061e7df7d4614f3e15c05cfc9e34e86d1c8b43 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 29 Oct 2025 15:22:24 +0000 >Subject: [PATCH] Bug 41131: Don't allow limiting transfers from/to a single > branch > >We say that you cannot limit transfers internally within a branch, but >it seems we do allow you to, and don't show you when we do > >To test: >1 - Go to Admin->Library transfer limits >2 - On a branches page, uncheck the box for that branch > e.g. don't allow FIC to transfer to CPL from CPL >3 - Save >4 - Note the box is still checked >5 - Check the DB > SELECT * FROM branch_transfer_limits; >6 - There is a line to/from CPL! >7 - Apply patches >8 - updatedatabase >9 - Repeat 5 - the line is deleted! >10 - Try to create the rule again, not the box is now disabled >11 - Be sneaky, enable the box, uncheck it and save, no rule created >12 - Be sneaky, edit the HMTL for another button to make it limiting CPL to CPL, save, no rule created >13 - Sign off >--- > admin/branch_transfer_limits.pl | 1 + > .../data/mysql/atomicupdate/bug_41131.pl | 19 +++++++++++++++++++ > .../modules/admin/branch_transfer_limits.tt | 4 +++- > 3 files changed, 23 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_41131.pl > >diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl >index e9ea5211169..1b09a08d0b4 100755 >--- a/admin/branch_transfer_limits.pl >+++ b/admin/branch_transfer_limits.pl >@@ -65,6 +65,7 @@ if ( $input->param('updateLimits') && $op eq 'cud-update' ) { > > foreach my $code (@codes) { > foreach my $toBranch (@branchcodes) { >+ next if $toBranch eq $branchcode; > my $isSet = not $input->param( $code . "_" . $toBranch ); > if ($isSet) { > CreateBranchTransferLimit( $toBranch, $branchcode, $code ); >diff --git a/installer/data/mysql/atomicupdate/bug_41131.pl b/installer/data/mysql/atomicupdate/bug_41131.pl >new file mode 100755 >index 00000000000..6178d45157a >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_41131.pl >@@ -0,0 +1,19 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "41131", >+ description => "Delete transfer limits that are from a branch to the same branch", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Do you stuffs here >+ $dbh->do( >+ q{ >+ DELETE FROM branch_transfer_limits WHERE toBranch = fromBranch; >+ } >+ ); >+ say $out "Removed nonsensical transfer limits that prevent a branch transferring to itself"; >+ }, >+}; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >index 00787368b8a..1996502301b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >@@ -96,7 +96,9 @@ > ></td > > > <td> >- [% IF ( to_branch_loo.isChecked ) %] >+ [% IF ( to_branch_loo.toBranch == branchcode ) %] >+ <input type="checkbox" checked="checked" disabled="disabled" /> >+ [% ELSIF ( to_branch_loo.isChecked ) %] > <input > type="checkbox" > class="cb cb[% codes_loo.code | html %]" >-- >2.39.5
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 41131
: 188561