Bugzilla – Attachment 159943 Details for
Bug 35570
Add a generic master form in ILL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35570: Consider 'Standard' core backend
Bug-35570-Consider-Standard-core-backend.patch (text/plain), 3.98 KB, created by
Pedro Amorim
on 2023-12-18 11:35:52 UTC
(
hide
)
Description:
Bug 35570: Consider 'Standard' core backend
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-12-18 11:35:52 UTC
Size:
3.98 KB
patch
obsolete
>From 62afed98135fda1a96de7b56d1b3f66ce877f49a Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 15 Dec 2023 12:53:25 +0000 >Subject: [PATCH] Bug 35570: Consider 'Standard' core backend > >Added File::Basename qw( dirname ) >Sorted Koha:: dependencies alphabetically >DRYed load_backend a bit and included 'Standard' backend check >--- > Koha/ILL/Request.pm | 46 ++++++++++++++++++++++---------------- > Koha/ILL/Request/Config.pm | 2 +- > 2 files changed, 28 insertions(+), 20 deletions(-) > >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index e49e46693d..e85f807df3 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -25,22 +25,24 @@ use DateTime; > > use C4::Letters; > use Mojo::Util qw(deprecated); >+use File::Basename qw( dirname ); > >+use Koha::AuthorisedValue; >+use Koha::AuthorisedValues; >+use Koha::Biblios; > use Koha::Cache::Memory::Lite; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Exceptions::Ill; >+use Koha::ILL::Backend::Standard; >+use Koha::ILL::Batches; > use Koha::ILL::Comments; > use Koha::ILL::Request::Attributes; >-use Koha::AuthorisedValue; > use Koha::ILL::Request::Logger; >-use Koha::Patron; >-use Koha::ILL::Batches; >-use Koha::AuthorisedValues; >-use Koha::Biblios; >-use Koha::Items; > use Koha::ItemTypes; >+use Koha::Items; > use Koha::Libraries; >+use Koha::Patron; > > use C4::Circulation qw( CanBookBeIssued AddIssue ); > >@@ -435,18 +437,24 @@ sub load_backend { > "An invalid backend ID was requested ('')"); > } > >+ my $backend_params = { >+ config => $self->_config, >+ logger => Koha::ILL::Request::Logger->new >+ }; >+ > my $backend_plugin = $self->get_backend_plugin($backend_name); >- if ($backend_plugin) { >+ >+ if ( $backend_name eq 'Standard' ) { >+ >+ # Load the Standard core backend >+ $self->{_my_backend} = Koha::ILL::Backend::Standard->new($backend_params); >+ return $self; >+ } elsif ($backend_plugin) { > > # New way of loading backends: Through plugins > my $backend_plugin_class = $backend_plugin->{class}; > >- $self->{_my_backend} = $backend_plugin_class->new_backend( >- { >- config => $self->_config, >- logger => Koha::ILL::Request::Logger->new >- } >- ); >+ $self->{_my_backend} = $backend_plugin_class->new_backend($backend_params); > } elsif ($backend_name) { > > # Old way of loading backends: Through backend_dir config >@@ -454,12 +462,7 @@ sub load_backend { > my $location = join "/", @raw, $backend_name, "Base.pm"; # File to load > my $backend_class = join "::", @raw, $backend_name, "Base"; # Package name > require $location; >- $self->{_my_backend} = $backend_class->new( >- { >- config => $self->_config, >- logger => Koha::ILL::Request::Logger->new >- } >- ); >+ $self->{_my_backend} = $backend_class->new($backend_params); > } > > return $self; >@@ -1089,6 +1092,11 @@ sub expand_template { > # New way of loading backends: Through plugins > $backend_dir = $backend_plugin->bundle_path; > $backend_tmpl = $backend_dir; >+ >+ } elsif ( $backend eq 'Standard' ) { >+ >+ # Check for core Standard backend >+ $backend_tmpl = dirname(__FILE__) . '/Backend'; > } else { > > # Old way of loading backends: Through backend_dir config >diff --git a/Koha/ILL/Request/Config.pm b/Koha/ILL/Request/Config.pm >index 61aac9f3b8..6ea73ee1c8 100644 >--- a/Koha/ILL/Request/Config.pm >+++ b/Koha/ILL/Request/Config.pm >@@ -151,7 +151,7 @@ sub available_backends { > > # Return unique list of backend names in the event that the same backend is > # installed as a plugin AND as the old way through backend_dir >- my @all_backends = ( @backends, @backend_plugins_names ); >+ my @all_backends = ( @backends, @backend_plugins_names, 'Standard' ); > my @all_uniq_backends = uniq(@all_backends); > > return \@all_uniq_backends; >-- >2.30.2
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 35570
:
159942
|
159943
|
159944
|
159946
|
159947
|
160452
|
160457
|
160654
|
160655
|
160656
|
160657
|
160658
|
160659
|
160660
|
160686
|
161519
|
161520
|
161521
|
161522
|
161523
|
161524
|
162894
|
162897
|
162898
|
162899
|
162900
|
162901
|
162902
|
162903
|
162904
|
162905
|
164277
|
164278
|
164279
|
164280
|
164281
|
164282
|
164283
|
164284
|
165204
|
165205
|
165206
|
165207
|
165208
|
165209
|
165210
|
165211
|
165286
|
165287
|
165288
|
165289
|
165290
|
165291
|
165292
|
165293
|
167050
|
167051
|
171312
|
171313
|
171314
|
171315
|
171316
|
171317
|
171318
|
171319
|
171320
|
171321
|
171322
|
171323
|
172218
|
172219
|
172722
|
172723
|
172724
|
172725
|
172726
|
172727
|
172728
|
172729
|
172730
|
172731
|
172732
|
172733
|
172734
|
172735
|
172740
|
172741
|
172742
|
172743
|
172744
|
172745
|
172746
|
172747
|
172748
|
172749
|
172750
|
172751
|
172752
|
172753
|
172780
|
172809
|
172811
|
173916
|
173917
|
173918