Bugzilla – Attachment 64344 Details for
Bug 13707
Adding a new column datereceived for items and biblioitems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13707: (follow-up) Fix failing unit test t/db_dependent/Datereceived.t
Bug-13707-follow-up-Fix-failing-unit-test-tdbdepen.patch (text/plain), 2.60 KB, created by
Lari Taskula
on 2017-06-15 17:32:08 UTC
(
hide
)
Description:
Bug 13707: (follow-up) Fix failing unit test t/db_dependent/Datereceived.t
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2017-06-15 17:32:08 UTC
Size:
2.60 KB
patch
obsolete
>From 6a9660e4e463c158071f5a3c45ea9f3b5ecc4621 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Thu, 15 Jun 2017 20:10:50 +0300 >Subject: [PATCH] Bug 13707: (follow-up) Fix failing unit test > t/db_dependent/Datereceived.t > >To replicate: >1. Before applying patch, prove t/db_dependent/Datereceived.t > >To test: >1. Apply patch >2. prove t/db_dependent/Datereceived.t >--- > C4/Biblio.pm | 2 ++ > C4/Items.pm | 2 +- > t/db_dependent/Datereceived.t | 3 ++- > 3 files changed, 5 insertions(+), 2 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index ff265e3..f3d7bf3 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2589,6 +2589,7 @@ sub UpdateDatereceived { > > my $bibdata; > unless (ref $biblionumberOrBibliodata) { #We have a SCALAR, eg. a biblionumber. >+ return 'NO_BIBLIONUMBER' unless defined $biblionumberOrBibliodata; > my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber($biblionumberOrBibliodata); > $bibdata = $biblioitems[0]; > } >@@ -2603,6 +2604,7 @@ sub UpdateDatereceived { > } > #Use the given DateTime or Use Now() > $datereceived = ($datereceived) ? $datereceived->iso8601() : DateTime->now( time_zone => C4::Context->tz() )->iso8601(); >+ $datereceived =~ s/T/ / if defined $datereceived; > > #Make sure to only update the datereceived for the Biblio if it hasn't been set yet. > if ($bibdata->{datereceived}) { >diff --git a/C4/Items.pm b/C4/Items.pm >index 2c43dad..628770a 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2070,7 +2070,7 @@ sub _mod_item_dates { # date formatting for date fields in item hash > > my $newstr; > if( defined $dt && ref($dt) eq 'DateTime' ) { >- if( $key =~ /datetime/ ) { >+ if( $key =~ /datetime|datereceived/ ) { > $newstr = DateTime::Format::MySQL->format_datetime($dt); > } else { > $newstr = DateTime::Format::MySQL->format_date($dt); >diff --git a/t/db_dependent/Datereceived.t b/t/db_dependent/Datereceived.t >index 232e71f..df4fd1a 100644 >--- a/t/db_dependent/Datereceived.t >+++ b/t/db_dependent/Datereceived.t >@@ -109,6 +109,7 @@ my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = C4::Items::AddItem( > holdingbranch => 'MPL', > barcode => 'R00000342', > replacementprice => 12.00, >+ itype => 'BK', > datereceived => $datereceivedIso, > }, > $biblionumber >@@ -199,4 +200,4 @@ ok( ($error eq 'NOT_DATETIME'), > "Searchable datereceived: ERROR, Not a DateTime caught."); > > >-$dbh->rollback(); >\ No newline at end of file >+$dbh->rollback(); >-- >2.7.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 13707
:
35908
|
35909
|
35910
|
35917
|
35933
|
35944
|
35945
|
35946
|
35966
|
35967
|
35968
|
35970
|
42391
|
42394
|
64343
| 64344