Bugzilla – Attachment 36594 Details for
Bug 11998
Syspref caching issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11998 - fix some compile warnings
Bug-11998---fix-some-compile-warnings.patch (text/plain), 3.11 KB, created by
Brendan Gallagher
on 2015-03-05 13:38:04 UTC
(
hide
)
Description:
Bug 11998 - fix some compile warnings
Filename:
MIME Type:
Creator:
Brendan Gallagher
Created:
2015-03-05 13:38:04 UTC
Size:
3.11 KB
patch
obsolete
>From cde18cf2901cba5ac986e7772bb9e419115c72d4 Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Wed, 26 Nov 2014 17:56:37 +1300 >Subject: [PATCH] Bug 11998 - fix some compile warnings > >This lazy-loads C4::Context and some other modules so that they can be >be safely used by C4::Context without introducing problematic circular >dependencies. > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >--- > C4/Log.pm | 13 ++++++++----- > Koha/Database.pm | 4 ++-- > 2 files changed, 10 insertions(+), 7 deletions(-) > >diff --git a/C4/Log.pm b/C4/Log.pm >index 80c3493..9bdee99 100644 >--- a/C4/Log.pm >+++ b/C4/Log.pm >@@ -24,9 +24,6 @@ package C4::Log; > use strict; > use warnings; > >-use C4::Context; >-use C4::Dates qw(format_date); >- > use vars qw($VERSION @ISA @EXPORT); > > BEGIN { >@@ -68,6 +65,8 @@ number is set to 0, which is the same as the superlibrarian's number. > sub logaction { > my ($modulename, $actionname, $objectnumber, $infos)=@_; > >+ # Require on demand so we can be called from C4::Context; >+ require C4::Context; > # Get ID of logged in user. if called from a batch job, > # no user session exists and C4::Context->userenv() returns > # the scalar '0'. >@@ -97,6 +96,7 @@ C<$status> is a hasref like this example: > > #' > sub GetLogStatus { >+ require C4::Context; > my %hash; > $hash{BorrowersLog} = C4::Context->preference("BorrowersLog"); > $hash{CataloguingLog} = C4::Context->preference("CataloguingLog"); >@@ -122,7 +122,8 @@ returns a table of hash containing who did what on which object at what time > > #' > sub displaylog { >- my ($modulename, @filters) = @_; >+ my ($modulename, @filters) = @_; >+ require C4::Context; > my $dbh = C4::Context->dbh; > my $strsth=qq| > SELECT action_logs.timestamp, action_logs.action, action_logs.info, >@@ -173,10 +174,11 @@ sub displaylog { > my @results; > my $count; > my $hilighted=1; >+ require C4::Dates; > while (my $data = $sth->fetchrow_hashref){ > $data->{hilighted} = ($hilighted>0); > $data->{info} =~ s/\n/<br\/>/g; >- $data->{day} = format_date($data->{timestamp}); >+ $data->{day} = C4::Dates::format_date($data->{timestamp}); > push @results, $data; > $count++; > $hilighted = -$hilighted; >@@ -202,6 +204,7 @@ sub GetLogs { > my $object = shift; > my $info = shift; > >+ require C4::Context; > my $iso_datefrom = C4::Dates->new($datefrom,C4::Context->preference("dateformat"))->output('iso'); > my $iso_dateto = C4::Dates->new($dateto,C4::Context->preference("dateformat"))->output('iso'); > >diff --git a/Koha/Database.pm b/Koha/Database.pm >index 5587570..5291924 100644 >--- a/Koha/Database.pm >+++ b/Koha/Database.pm >@@ -34,7 +34,7 @@ Koha::Database > > use Modern::Perl; > use Carp; >-use C4::Context; >+use Koha::Schema; > use base qw(Class::Accessor); > > use vars qw($database); >@@ -47,7 +47,7 @@ __PACKAGE__->mk_accessors(qw( )); > # returns it. > sub _new_schema { > >- require Koha::Schema; >+ require C4::Context; > my $context = C4::Context->new(); > > # we are letting C4::Context->dbh not set the RaiseError handle attribute >-- >1.7.10.4
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 11998
:
26575
|
26621
|
26714
|
26716
|
26717
|
27382
|
31801
|
31802
|
32870
|
32871
|
32872
|
32873
|
32874
|
33183
|
33447
|
33670
|
33671
|
33685
|
33724
|
33725
|
33746
|
33829
|
33940
|
36523
|
36524
|
36525
|
36526
|
36527
|
36528
|
36529
|
36530
|
36531
|
36532
|
36533
|
36534
|
36571
|
36583
|
36584
|
36585
|
36586
|
36587
|
36588
|
36589
|
36590
|
36591
|
36592
|
36593
|
36594
|
36595
|
48640
|
48652
|
48655
|
48687
|
48688
|
48727
|
48758
|
48928
|
48929
|
48930
|
48931
|
48932
|
48933
|
48934
|
48935
|
48936
|
48961
|
49022
|
49023
|
49024
|
49025
|
49026
|
49027
|
49028
|
49029
|
49030
|
49100
|
49101
|
49102
|
49103
|
49104
|
49105
|
49106
|
49107
|
49108