Bugzilla – Attachment 90466 Details for
Bug 23045
Advanced cataloging editor (rancor) throws a JS error on incomplete/blank lines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23045: TextMarc errors on blank lines
Bug-23045-TextMarc-errors-on-blank-lines.patch (text/plain), 2.37 KB, created by
Liz Rea
on 2019-06-10 21:21:59 UTC
(
hide
)
Description:
Bug 23045: TextMarc errors on blank lines
Filename:
MIME Type:
Creator:
Liz Rea
Created:
2019-06-10 21:21:59 UTC
Size:
2.37 KB
patch
obsolete
>From de78c7b88fa4d37eba779d12bce20645550efd73 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 4 Jun 2019 14:25:53 +0000 >Subject: [PATCH] Bug 23045: TextMarc errors on blank lines > >Since bug 16251 we use TextMarc to get some record fields, however, it throws an error when >processing blank lines. > >We should just pass on these rather then erroring > >To test: >1 - Define a new macro that delete more fields than it adds > delete 245 >2 - Run it >3 - Note an error in JS console, and helpers will not load >4 - Apply patch >5 - Reload, try again >6 - No error > >Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >--- > koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js | 3 +-- > koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc | 1 + > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js >index 0440a99822..5846045bb7 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js >@@ -48,10 +48,9 @@ define( [ 'marc-record' ], function( MARC ) { > TextToRecord: function( text ) { > var record = new MARC.Record(); > var errors = []; >- > $.each( text.split('\n'), function( i, line ) { >+ if (line === "") {return}; > var tagNumber = line.match( /^([A-Za-z0-9]{3}) / ); >- > if ( !tagNumber ) { > errors.push( { type: 'noTag', line: i } ); > return; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc >index 3c4594f7ff..ab5e655080 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc >@@ -282,6 +282,7 @@ require( [ 'koha-backend', 'widget', 'text-marc' ], function( KohaBackend, Widge > }, > getMaterial: function () { > const record = TextMarc.TextToRecord(this.editor.cm.getValue()); >+ > const leader = record.leader(); > const leader6 = leader.substring(6, 7); > let materialType = this.materialTypeMapping[leader6]; >-- >2.11.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 23045
:
90320
|
90405
|
90411
|
90466
|
90467
|
91136
|
91137