From 0bf4cdba9a5432e3efa920da073f8f5fa7e6656d Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 4 Aug 2008 10:15:23 -0500 Subject: [PATCH] bug 2459: fix module depedency error blocking SIP2 Ror a poorly understood (by me) reason, use of 'use UNIVERSAL' and 'use C4::Auth' in the SIP2 code is resulting in a compilation error, thus blocking SIP2 from working. The error (prior to this patch) could be reproduced as follows: cd C4/SIP perl -I. -wc Sip/MsgType.pm "get_session" is not exported by the C4::Auth module Can't continue after import errors at /home/gmc/koha/dev/C4/VirtualShelves.pm line 51 BEGIN failed--compilation aborted at /home/gmc/koha/dev/C4/VirtualShelves.pm line 51. Compilation failed in require at /home/gmc/koha/dev/C4/Auth.pm line 34. BEGIN failed--compilation aborted at /home/gmc/koha/dev/C4/Auth.pm line 34. Compilation failed in require at Sip/MsgType.pm line 21. BEGIN failed--compilation aborted at Sip/MsgType.pm line 21. or more minimally perl -ce 'use UNIVERSAL; use C4::Auth;' This patch works around the problem by making C4::Auth and C4::VirtualShelves not import any symbols from each other. Signed-off-by: Joshua Ferraro --- C4/Auth.pm | 8 ++++---- C4/VirtualShelves.pm | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 8bc8572cdf..029a9572c5 100755 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -31,7 +31,7 @@ use C4::Output; # to get the template use C4::Members; use C4::Koha; use C4::Branch; # GetBranches -use C4::VirtualShelves qw/GetRecentShelves/; +use C4::VirtualShelves; # use utf8; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $ldap); @@ -711,9 +711,9 @@ sub checkauth { # and the number of lists to be displayed of each type in the 'Lists' button drop down my $row_count = 10; # FIXME:This probably should be a syspref my ($total, $totshelves, $barshelves, $pubshelves); - ($barshelves, $totshelves) = GetRecentShelves(1, $row_count, $borrowernumber); + ($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber); $total->{'bartotal'} = $totshelves; - ($pubshelves, $totshelves) = GetRecentShelves(2, $row_count, undef); + ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef); $total->{'pubtotal'} = $totshelves; $session->param('barshelves', $barshelves->[0]); $session->param('pubshelves', $pubshelves->[0]); @@ -738,7 +738,7 @@ sub checkauth { # Grab the public shelves and add to the session... my $row_count = 20; # FIXME:This probably should be a syspref my ($total, $totshelves, $pubshelves); - ($pubshelves, $totshelves) = GetRecentShelves(2, $row_count, undef); + ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef); $total->{'pubtotal'} = $totshelves; $session->param('pubshelves', $pubshelves->[0]); $session->param('totshelves', $total); diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index eaebb54672..3a9efd03f4 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -27,6 +27,7 @@ use C4::Context; use C4::Circulation; use C4::Debug; use C4::Members; +require C4::Auth; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); @@ -48,7 +49,6 @@ BEGIN { ); } -use C4::Auth qw(get_session); my $dbh = C4::Context->dbh; @@ -544,7 +544,7 @@ This function is used in conjunction with the 'Lists' button in masthead.inc. sub RefreshShelvesSummary ($$$) { my ($sessionID, $loggedinuser, $row_count) = @_; - my $session = get_session($sessionID); + my $session = C4::Auth::get_session($sessionID); my ($total, $totshelves, $barshelves, $pubshelves); ($barshelves, $totshelves) = GetRecentShelves(1, $row_count, $loggedinuser); -- 2.39.5