Bugzilla – Attachment 47808 Details for
Bug 15769
C4::Koha::slashifyDate is outdated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15769: Remove outdated C4::Koha::slashifyDate subroutine
Bug-15769-Remove-outdated-C4KohaslashifyDate-subro.patch (text/plain), 3.47 KB, created by
Jonathan Druart
on 2016-02-09 13:41:47 UTC
(
hide
)
Description:
Bug 15769: Remove outdated C4::Koha::slashifyDate subroutine
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-02-09 13:41:47 UTC
Size:
3.47 KB
patch
obsolete
>From 00acf26ac4b4343906e0bf2f69051d74000b2471 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 9 Feb 2016 13:40:01 +0000 >Subject: [PATCH] Bug 15769: Remove outdated C4::Koha::slashifyDate subroutine > >This subroutine does not make sense anymore (Koha::DateUtils should be >used) and is no longer used. >It can be removed safely. > >Test plan: > git grep slashifyDate >should not return any results > > prove t/Koha.t >and > prove t/db_dependent/Koha.t >should return green >--- > C4/Koha.pm | 18 ------------------ > t/Koha.t | 9 +-------- > t/db_dependent/Koha.t | 13 +++---------- > 3 files changed, 4 insertions(+), 36 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 7171f16..6c99065 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -39,7 +39,6 @@ BEGIN { > require Exporter; > @ISA = qw(Exporter); > @EXPORT = qw( >- &slashifyDate > &subfield_is_koha_internal_p > &GetPrinters &GetPrinter > &GetItemTypes &getitemtypeinfo >@@ -100,23 +99,6 @@ Koha.pm provides many functions for Koha scripts. > > =cut > >-=head2 slashifyDate >- >- $slash_date = &slashifyDate($dash_date); >- >-Takes a string of the form "DD-MM-YYYY" (or anything separated by >-dashes), converts it to the form "YYYY/MM/DD", and returns the result. >- >-=cut >- >-sub slashifyDate { >- >- # accepts a date of the form xx-xx-xx[xx] and returns it in the >- # form xx/xx/xx[xx] >- my @dateOut = split( '-', shift ); >- return ("$dateOut[2]/$dateOut[1]/$dateOut[0]"); >-} >- > # FIXME.. this should be moved to a MARC-specific module > sub subfield_is_koha_internal_p { > my ($subfield) = @_; >diff --git a/t/Koha.t b/t/Koha.t >index 364020d..366a21b 100755 >--- a/t/Koha.t >+++ b/t/Koha.t >@@ -25,7 +25,7 @@ use Module::Load::Conditional qw/check_install/; > > BEGIN { > if ( check_install( module => 'Test::DBIx::Class' ) ) { >- plan tests => 34; >+ plan tests => 33; > } else { > plan skip_all => "Need Test::DBIx::Class" > } >@@ -63,18 +63,11 @@ is ( IsAuthorisedValueCategory('LOC'), 1, 'LOC is a valid authorized value categ > is ( IsAuthorisedValueCategory('something'), 0, 'something is not a valid authorized value category'); > is ( IsAuthorisedValueCategory('RELTERMS'), 1, 'RELTERMS is a valid authorized value category'); > >-# >-# test that &slashifyDate returns correct (non-US) date >-# >-my $date = "01/01/2002"; >-my $newdate = &slashifyDate("2002-01-01"); > my $isbn13 = "9780330356473"; > my $isbn13D = "978-0-330-35647-3"; > my $isbn10 = "033035647X"; > my $isbn10D = "0-330-35647-X"; > >-ok($date eq $newdate, 'slashifyDate'); >- > my $undef = undef; > is(xml_escape($undef), '', 'xml_escape() returns empty string on undef input'); > my $str = q{'"&<>'}; >diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t >index c013434..0207cf5 100644 >--- a/t/db_dependent/Koha.t >+++ b/t/db_dependent/Koha.t >@@ -204,21 +204,14 @@ $dbh->do($sql); > } > > >-# >-# test that &slashifyDate returns correct (non-US) date >-# >-subtest 'Date and ISBN tests' => sub { >- plan tests => 7; >+subtest 'ISBN tests' => sub { >+ plan tests => 6; > >- my $date = "01/01/2002"; >- my $newdate = &slashifyDate("2002-01-01"); > my $isbn13 = "9780330356473"; > my $isbn13D = "978-0-330-35647-3"; > my $isbn10 = "033035647X"; > my $isbn10D = "0-330-35647-X"; >- ok( $date eq $newdate, 'slashifyDate' ); >- my $undef = undef; >- is( xml_escape($undef), '', >+ is( xml_escape(undef), '', > 'xml_escape() returns empty string on undef input' ); > my $str = q{'"&<>'}; > is( >-- >2.1.0
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 15769
:
47808
|
47827
|
47951