Bugzilla – Attachment 11703 Details for
Bug 8656
Koha::Calendar not loading both sets of special dates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed Patch
0001-Bug-8656-Calendar-needs-to-load-both-exception-and-n.patch (text/plain), 2.34 KB, created by
Colin Campbell
on 2012-08-20 14:37:10 UTC
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2012-08-20 14:37:10 UTC
Size:
2.34 KB
patch
obsolete
>From 095a25b43ce5dc7ff8d61fbf312166ea5d021ede Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Mon, 20 Aug 2012 15:24:58 +0100 >Subject: [PATCH] Bug 8656 Calendar needs to load both exception and > nonexception dates > >single_holidays and exception_holidays were both being selected >with the same parameter with the result that single holidays were not >being loaded. > >Have removed the retrieval of the unused parameters title and >description. > >In effect the distinction is not meaningful for these routines and >the two structures could become one. This patch just fixes the >current bug >--- > Koha/Calendar.pm | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm >index 7214f39..2a2e062 100644 >--- a/Koha/Calendar.pm >+++ b/Koha/Calendar.pm >@@ -48,13 +48,13 @@ sub _init { > $self->{day_month_closed_days}->{ $tuple->{month} }->{ $tuple->{day} } = > 1; > } >+ > my $special = $dbh->prepare( >-'SELECT day, month, year, title, description FROM special_holidays WHERE ( branchcode = ? ) AND (isexception = ?)' >+'SELECT day, month, year FROM special_holidays WHERE branchcode = ? AND isexception = ?' > ); > $special->execute( $branch, 1 ); > my $dates = []; >- while ( my ( $day, $month, $year, $title, $description ) = >- $special->fetchrow ) { >+ while ( my ( $day, $month, $year ) = $special->fetchrow ) { > push @{$dates}, > DateTime->new( > day => $day, >@@ -65,10 +65,10 @@ sub _init { > } > $self->{exception_holidays} = > DateTime::Set->from_datetimes( dates => $dates ); >- $special->execute( $branch, 1 ); >+ >+ $special->execute( $branch, 0 ); > $dates = []; >- while ( my ( $day, $month, $year, $title, $description ) = >- $special->fetchrow ) { >+ while ( my ( $day, $month, $year ) = $special->fetchrow ) { > push @{$dates}, > DateTime->new( > day => $day, >@@ -78,8 +78,8 @@ sub _init { > )->truncate( to => 'day' ); > } > $self->{single_holidays} = DateTime::Set->from_datetimes( dates => $dates ); >- $self->{days_mode} = C4::Context->preference('useDaysMode'); >- $self->{test} = 0; >+ $self->{days_mode} = C4::Context->preference('useDaysMode'); >+ $self->{test} = 0; > return; > } > >-- >1.7.12.rc2.18.g61b472e >
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 8656
:
11703
|
11734