Bugzilla – Attachment 172741 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), 4.04 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-10-14 18:01:14 UTC
(
hide
)
Description:
Bug 35570: Consider 'Standard' core backend
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-10-14 18:01:14 UTC
Size:
4.04 KB
patch
obsolete
>From 76499d7d741ab2abffd8d72c7fe7e119140f6ff5 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 > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/ILL/Request.pm | 45 ++++++++++++++++++++++---------------- > Koha/ILL/Request/Config.pm | 2 +- > 2 files changed, 27 insertions(+), 20 deletions(-) > >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index e7347e5ee32..4df167d15fe 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -25,23 +25,25 @@ 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::AdditionalContents; >+use Koha::Patron; > > use C4::Circulation qw( CanBookBeIssued AddIssue ); > >@@ -435,16 +437,21 @@ sub load_backend { > "An invalid backend ID was requested ('')"); > } > >+ my $backend_params = { >+ config => $self->_config, >+ logger => Koha::ILL::Request::Logger->new >+ }; >+ > # Find plugin implementing the backend for the request > my $backend_plugin = $self->get_backend_plugin($backend_name); >- if ($backend_plugin) { > >- $self->{_my_backend} = $backend_plugin->new_ill_backend( >- { >- config => $self->_config, >- logger => Koha::ILL::Request::Logger->new >- } >- ); >+ if ( $backend_name eq 'Standard' ) { >+ >+ # Load the Standard core backend >+ $self->{_my_backend} = Koha::ILL::Backend::Standard->new($backend_params); >+ } elsif ($backend_plugin) { >+ >+ $self->{_my_backend} = $backend_plugin->new_ill_backend($backend_params); > } elsif ($backend_name) { > > # Fallback to loading through backend_dir config >@@ -452,12 +459,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; >@@ -1098,6 +1100,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 111317804c2..f4e19ff95f2 100644 >--- a/Koha/ILL/Request/Config.pm >+++ b/Koha/ILL/Request/Config.pm >@@ -147,7 +147,7 @@ sub available_backends { > @backends = glob "$backend_dir/*" if ($backend_dir); > @backends = map { basename($_) } @backends; > >- my @all_backends = ( @backends, @backend_plugins_names ); >+ my @all_backends = ( @backends, @backend_plugins_names, 'Standard' ); > @all_backends = grep { $_ =~ /$reduce/ } @all_backends if $reduce; > > # Return unique list of backend names in the event that the same backend is >-- >2.47.0
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