Bugzilla – Attachment 26018 Details for
Bug 11912
GetMarcISBN wrongly prepends a space to ISBNs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11912: (refactoring followup) GetMarcISBN should implement its advertised API
Bug-11912-refactoring-followup-GetMarcISBN-should-.patch (text/plain), 4.23 KB, created by
Tomás Cohen Arazi (tcohen)
on 2014-03-10 15:11:00 UTC
(
hide
)
Description:
Bug 11912: (refactoring followup) GetMarcISBN should implement its advertised API
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2014-03-10 15:11:00 UTC
Size:
4.23 KB
patch
obsolete
>From 39daf2f0773bd2d31cca420ab4d91f46f1a4f551 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Mon, 10 Mar 2014 11:52:19 -0300 >Subject: [PATCH] Bug 11912: (refactoring followup) GetMarcISBN should > implement its advertised API > >The current implementation of GetMarcISBN contradicts the documented API. >It currently returns an array of hashes with only one key (marcisbn) which >doesn't add any value to it. > >I chose to fix GetMarcISBN to honour the API instead of changing the docs, >because it seems a really silly change. > >To test: >- Run: > prove t/db_dependent/Biblio.t >=> SUCCESS >- catalogue/detail.pl should correctly show ISBNs. >- opac/opac-detail.pl should correctly show ISBNs in both prog and bootstrap. >- opac-opac-sendshelf.pl should correctly show ISBNs in the email. >- Sign off :-D > >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba >--- > C4/Biblio.pm | 5 ++--- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt | 2 +- > koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt | 2 +- > t/db_dependent/Biblio.t | 1 - > 5 files changed, 5 insertions(+), 7 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index a34e5b6..61e4c3b 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1689,13 +1689,12 @@ sub GetMarcISBN { > } else { # assume marc21 if not unimarc > $scope = '020'; > } >+ > my @marcisbns; >- my $marcisbn; > foreach my $field ( $record->field($scope) ) { > my $isbn = $field->as_string(); > if ( $isbn ne "" ) { >- $marcisbn = { marcisbn => $isbn, }; >- push @marcisbns, $marcisbn; >+ push @marcisbns, $isbn; > } > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 1e1fcd2..03e322d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -416,7 +416,7 @@ function verify_images() { > <div class="yui-u" style="margin-top: 1em;"> > <ul> > [% IF ( MARCISBNS ) %] >- <li><strong>ISBN:</strong><ul>[% FOREACH MARCISBN IN MARCISBNS %]<li>[% MARCISBN.marcisbn %]</li>[% END %]</ul></li> >+ <li><strong>ISBN:</strong><ul>[% FOREACH MARCISBN IN MARCISBNS %]<li>[% MARCISBN %]</li>[% END %]</ul></li> > [% ELSE %] > [% IF ( normalized_isbn ) %] > <li><strong>ISBN:</strong> [% normalized_isbn %]</li> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt >index c13a659..f3c7ed7 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt >@@ -59,7 +59,7 @@ Your list : [% shelfname %] > [% IF ( BIBLIO_RESULT.ISBN && BIBLIO_RESULT.size > 0 ) %] > <span> > ISBN: [% FOREACH isbn IN BIBLIO_RESULT.ISBN %] >- [% isbn.marcisbn %] >+ [% isbn %] > [% UNLESS ( loop.last ) %]; [% END %] > [% END %] > </span><br/> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt >index c13a659..f3c7ed7 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt >@@ -59,7 +59,7 @@ Your list : [% shelfname %] > [% IF ( BIBLIO_RESULT.ISBN && BIBLIO_RESULT.size > 0 ) %] > <span> > ISBN: [% FOREACH isbn IN BIBLIO_RESULT.ISBN %] >- [% isbn.marcisbn %] >+ [% isbn %] > [% UNLESS ( loop.last ) %]; [% END %] > [% END %] > </span><br/> >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index 2dd8034..69c3cf7 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -19,7 +19,6 @@ use Modern::Perl; > > use Test::More tests => 3; > use Test::MockModule; >-use Data::Dumper; > > use MARC::Record; > >-- >1.8.3.2
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 11912
:
25968
|
25969
|
26018
|
26019
|
26277
|
26286
|
26287
|
26288
|
26471
|
26472
|
26473
|
26474
|
26475