From 9469b0c32f45071e9fdae079e4cb25f451d6dfb7 Mon Sep 17 00:00:00 2001
From: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Date: Mon, 28 Apr 2025 15:02:50 +0000
Subject: [PATCH] Bug 39765: Revert plugin check logic

Apply patch. Run tests.
prove t/db_dependent/Koha/ILL/Requests.t
---
 Koha/ILL/Request.pm | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm
index 870c0710757..a8f908168aa 100644
--- a/Koha/ILL/Request.pm
+++ b/Koha/ILL/Request.pm
@@ -1166,19 +1166,15 @@ sub expand_template {
         $params->{opac_template} = $template_name;
 
     } else {
-        my $plugin =
-              $self->{_plugin}
-            ? $self->{_plugin}
-            : $self->get_plugin( $self->_backend->name );
 
         # Generate path to file to load
         my $backend_dir;
         my $backend_tmpl;
 
-        if ($plugin) {
+        if ( $self->{_plugin} ) {
 
             # New way of loading backends: Through plugins
-            $backend_dir  = $plugin->bundle_path;
+            $backend_dir  = $self->{_plugin}->bundle_path;
             $backend_tmpl = $backend_dir;
 
         } else {
-- 
2.39.5