From d7c768e98b76d8a33d56a3fdc249681dbf096026 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 17 Nov 2015 12:36:16 +1100 Subject: [PATCH] Bug 15182: Conditionally load Koha::NorwegianPatronDB MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch loads Koha::NorwegianPatronDB if it can, or adds a warning to the log if it can't load it. Since the Koha::NorwegianPatronDB functionality in C4::Members is wrapped in system preferences, the loading of the module is irrelevant unless one actually wants to use the module and its associated functionality. NOTE: This patch fixes a problem where we were getting errors saying Crypt::GCrypt couldn't be loaded even though it's not a required dependency. This patch will likely only affect people not using Debian-based systems where libcrypt-gcrypt-perl is available. The current version of Crypt::GCrypt doesn't build so it's not an option for most non-Debian users to install this not required dependency in order to work around this issue... Signed-off-by: Hector Castro Works as advertised for Debian-based systems Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 1801a9462e190231f3303b01247b834f6e1d99bd) Signed-off-by: Frédéric Demians (cherry picked from commit 3b510cee00e5960eff43800d9df978123061b9b6) Signed-off-by: Liz Rea --- C4/Members.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C4/Members.pm b/C4/Members.pm index 86f00b0a7f..e093068ad4 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -43,7 +43,11 @@ use Koha::Borrower::Debarments qw(IsDebarred); use Text::Unaccent qw( unac_string ); use Koha::AuthUtils qw(hash_password); use Koha::Database; -require Koha::NorwegianPatronDB; + +use Module::Load::Conditional qw( can_load ); +if ( ! can_load( modules => { 'Koha::NorwegianPatronDB' => undef } ) ) { + warn "Unable to load Koha::NorwegianPatronDB"; +} our ($VERSION,@ISA,@EXPORT,@EXPORT_OK,$debug); -- 2.39.5