Bugzilla – Attachment 2379 Details for
Bug 5021
serials should handle 'unknown' more gracefully
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed Patch
0001-Bug-5021-Formatting-of-undefined-serials-dates.patch (text/plain), 1.62 KB, created by
Colin Campbell
on 2010-07-16 12:05:09 UTC
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2010-07-16 12:05:09 UTC
Size:
1.62 KB
patch
obsolete
>From 0119bb9c3cf82233733341a77e5a8145ef8ce845 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Fri, 16 Jul 2010 12:47:26 +0100 >Subject: [PATCH] Bug 5021 Formatting of undefined serials dates >Content-Type: text/plain; charset="utf-8" > >Routine was checking undefinedness but such dates were >normalized on retrieval to 0000-00-00 >Also planned/received date should also be checked >--- > C4/Serials.pm | 17 ++++++++++------- > 1 files changed, 10 insertions(+), 7 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 35cc5be..032246c 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -405,14 +405,17 @@ sub PrepareSerialsData { > my $first; > my $previousnote = ""; > >- foreach my $subs (@$lines) { >- $subs->{'publisheddate'} = ( >- $subs->{'publisheddate'} >- ? format_date( $subs->{'publisheddate'} ) >- : "XXX" >- ); >+ foreach my $subs (@{$lines}) { >+ for my $datefield ( qw(publisheddate planneddate) ) { >+ # handle both undef and undef returned as 0000-00-00 >+ if (!defined $subs->{$datefield} or $subs->{$datefield}=~m/^00/) { >+ $subs->{$datefield} = 'XXX'; >+ } >+ else { >+ $subs->{$datefield} = format_date( $subs->{$datefield} ); >+ } >+ } > $subs->{'branchname'} = GetBranchName( $subs->{'branchcode'} ); >- $subs->{'planneddate'} = format_date( $subs->{'planneddate'} ); > $subs->{ "status" . $subs->{'status'} } = 1; > $subs->{"checked"} = $subs->{'status'} =~ /1|3|4|7/; > >-- >1.7.1.1 >
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 5021
:
2376
| 2379