[Koha-cvs] koha/C4 Koha.pm [dev_week]

Ryan Higgins rch at liblime.com
Fri Apr 20 16:01:32 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Ryan Higgins <rych>	07/04/20 14:01:32

Modified files:
	C4             : Koha.pm 

Log message:
	add test for userenv before trying to get its branch

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.22.2.4.2.11&r2=1.22.2.4.2.12

Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.22.2.4.2.11
retrieving revision 1.22.2.4.2.12
diff -u -b -r1.22.2.4.2.11 -r1.22.2.4.2.12
--- Koha.pm	19 Apr 2007 20:51:38 -0000	1.22.2.4.2.11
+++ Koha.pm	20 Apr 2007 14:01:32 -0000	1.22.2.4.2.12
@@ -606,9 +606,10 @@
 }
 sub getbranch ($$) {
     my($query, $branches) = @_; # get branch for this query from branches
-    my $branch = $query->param('branch');
-    ($branch) || ($branch = $query->cookie('branch'));
-    ($branches->{$branch}) || ( $branch = C4::Context->userenv->{'branch'} );
+    my $branch = $query->param('branch') || $branch = $query->cookie('branch');
+	if ( ( ! $branch) && C4::Context->userenv() ) {
+        $branch = C4::Context->userenv->{'branch'} ;
+    }
 	($branches->{$branch}) || ($branch=(keys %$branches)[0]);
     return $branch;
 }





More information about the Koha-cvs mailing list