Bugzilla – Attachment 6020 Details for
Bug 6977
Support for repeated subfields when importing an authority into a biblio record field.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Follow-up patch : catch CloneSubfield errors
0001-Follow-up-patch-catch-CloneSubfield-errors.patch (text/plain), 2.51 KB, created by
Frédérick Capovilla
on 2011-10-21 16:33:32 UTC
(
hide
)
Description:
Follow-up patch : catch CloneSubfield errors
Filename:
MIME Type:
Creator:
Frédérick Capovilla
Created:
2011-10-21 16:33:32 UTC
Size:
2.51 KB
patch
obsolete
>From 70560b84ee5641b6694a4ff09db4f783b159aa93 Mon Sep 17 00:00:00 2001 >From: =?utf-8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= <frederick.capovilla@libeo.com> >Date: Fri, 21 Oct 2011 12:04:03 -0400 >Subject: [PATCH] Follow-up patch : catch CloneSubfield errors > >A javascript error could occur if the CloneSubfield function failed for >any reason. This would prevent the popup from disappearing. > >Example : Importing informations of a UNIF_TITLE authority with multiple >$x subfields in the biblio's 440 field. 440$x isn't repeatable, so an >error occurs when trying to clone it. >--- > .../authorities/blinddetail-biblio-search.tt | 16 ++++++++++++---- > 1 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt >index 1697289..77a5d5f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt >@@ -33,10 +33,11 @@ > } > > // Sets the good number of form fields for the specified subfield >+ // Returns false if the cloning failed > function SetSubfieldNumber(subfield_name, nb) { > // Nothing to do if we only have one value > if(nb <= 1) { >- return; >+ return true; > } > > // Find the subfield we want to clone >@@ -45,10 +46,16 @@ > return this.id.match(re); > }); > >- // Add as many clones as needed >- for(var i=0; i<nb-subfields.length; i++) { >- window.opener.opener.CloneSubfield(subfields[0].getAttribute('id')); >+ // Try to add as many clones as needed >+ try { >+ for(var i=0; i<nb-subfields.length; i++) { >+ window.opener.opener.CloneSubfield(subfields[0].getAttribute('id')); >+ } >+ } >+ catch(err) { >+ return false; > } >+ return true; > } > > // Fills the subfield with the values entered in argument >@@ -61,6 +68,7 @@ > } > > // Create the correct number of form fields for all values >+ // If the field cloning failed, only the first value will be added to the form. > SetSubfieldNumber(subfield_name, values.length); > > // Find the subfields where we will add the new values >-- >1.5.6.5 >
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 6977
:
5719
|
5801
|
5851
|
6020
|
6285