Bugzilla – Attachment 90405 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.31 KB, created by
Claire Gravely
on 2019-06-07 06:15:39 UTC
(
hide
)
Description:
Bug 23045: TextMarc errors on blank lines
Filename:
MIME Type:
Creator:
Claire Gravely
Created:
2019-06-07 06:15:39 UTC
Size:
2.31 KB
patch
obsolete
>From 6821102bb11f949f440c25b5197fc56271bd49bf 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> >--- > 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 0440a99..5846045 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 3c4594f..ab5e655 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.1.4
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