[Koha-bugs] [Bug 14345] parsed isbn has semi-colon fails to nicely link for idreambooks

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jun 24 15:02:06 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14345

--- Comment #7 from Jonathan Druart <jonathan.druart at biblibre.com> ---
(In reply to M. Tompsett from comment #6)
> (In reply to Jonathan Druart from comment #5)
> > Silly question but... Why do you have an isbn ending in ';'?
> > Shouldn't the ibns be sent to the template once sanitized?
> 
> Because it is parsed from idreambooks in javascript, not from the perl.

And the first part for the question? :)

Just looking at the code, the isbns are retrieved from:

 228                         [% IF ( MARCISBNS ) %]
 229                             <span class="results_summary isbn"><span
class="label">ISBN:</span>
                                 [% FOREACH MARCISBN IN MARCISBNS %]
                                     [% MARCISBN %][% IF ( loop.last ) %].[%
ELSE %]; [% END %]
                                 [% END %]
                                 </span>
 230                         [% ELSE %]
 231                             [% IF ( normalized_isbn ) %]
 232                                 <span class="results_summary isbn"><span
class="label">ISBN: </span>[% normalized_isbn %]</span>
 233                             [% END %]
 234                         [% END %]

(I added some indentation for the readability).

Does the ';' you want to remove is the one generated by [% IF ( loop.last )
%].[% ELSE %]; [% END %]?

Because looking at the JS:
    var isbn = $(".isbn:last").text().split(" ")[1];
It seems that several .isbn is expected, but only one is created.

Maybe the template should be more something like:
<span class="results_summary isbns"><span class="label">ISBN:</span>
    [% FOREACH MARCISBN IN MARCISBNS %]
        <span class="isbn"[% MARCISBN %]</span>[% IF ( loop.last ) %].[% ELSE
%]; [% END %]
    [% END %]
</span>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list