Bug 15514: Fix error with certain repeatable fields in Rancor
authorJesse Weaver <jweaver@bywatersolutions.com>
Wed, 27 Jan 2016 23:39:22 +0000 (16:39 -0700)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Tue, 23 Feb 2016 23:15:28 +0000 (23:15 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js

index f02ab97..9e393d3 100644 (file)
@@ -224,7 +224,7 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin
                 var seenSubfields = {};
 
                 $.each( field.subfields(), function( undef, subfield ) {
-                    if ( seenSubfields[ subfield[0] ] != null && nonRepeatableSubfields[ field.tagnumber() ][ subfield[0] ] ) {
+                    if ( seenSubfields[ subfield[0] ] != null && ( nonRepeatableSubfields[ field.tagnumber() ] || {} )[ subfield[0] ] ) {
                         errors.push( { type: 'unrepeatableSubfield', subfield: subfield[0], line: field.sourceLine } );
                     } else {
                         seenSubfields[ subfield[0] ] = subfield[1];