Bugzilla – Attachment 43883 Details for
Bug 11559
Professional cataloger's interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11559: (QA followup) detect and warn about corruption caused by MARC-8
Bug-11559-QA-followup-detect-and-warn-about-corrup.patch (text/plain), 2.61 KB, created by
Jesse Weaver
on 2015-10-23 17:07:00 UTC
(
hide
)
Description:
Bug 11559: (QA followup) detect and warn about corruption caused by MARC-8
Filename:
MIME Type:
Creator:
Jesse Weaver
Created:
2015-10-23 17:07:00 UTC
Size:
2.61 KB
patch
obsolete
>From 0c80aef9ab3e8d857c982a7342c439289284e286 Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <pianohacker@gmail.com> >Date: Fri, 23 Oct 2015 11:06:39 -0600 >Subject: [PATCH] Bug 11559: (QA followup) detect and warn about corruption > caused by MARC-8 > >--- > koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-record.js | 11 +++++++++++ > koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc | 2 ++ > 2 files changed, 13 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-record.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-record.js >index f626eb3..d795511 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-record.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-record.js >@@ -244,6 +244,11 @@ define( function() { > // happens before UTF-8 encoding, but that won't cause any issues. > data = _encode_utf8(data.substr(0, parseInt(data.substr(0, 5)))); > >+ // For now, we can't decode MARC-8, so just mark the record as possibly corrupted. >+ if (data[9] != 'a') { >+ var marc8 = true; >+ } >+ > this._fieldlist.length = 0; > this.leader(data.substr(0, 24)); > var directory_len = parseInt(data.substring(12, 17), 0) - 25, >@@ -254,6 +259,12 @@ define( function() { > len = parseInt(data.substring(off+3, off+7), 0) - 1, > pos = parseInt(data.substring(off+7, off+12), 0) + 25 + directory_len, > value = data.substring(pos, pos+len); >+ >+ // No end-of-field character before this field, corruption! >+ if (marc8 && data[pos - 1] != '\x1E') { >+ this.marc8_corrupted = true; >+ } >+ > if ( parseInt(tag) < 10 ) { > this.addField( new MARC.Field( tag, '', '', [ [ '@', value ] ] ) ); > } else { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >index 4cc594f..fe792c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >@@ -909,6 +909,8 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > return; > } > >+ if (record.marc8_corrupted) humanMsg.displayMsg( '<h3>' + _("Possible record corruption") + '</h3><p>' + _("Record not marked as UTF-8, may be corrupted") + '</p>', { className: 'humanError' } ); >+ > editor.displayRecord( record ); > }; > >-- >2.6.1
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 11559
:
26069
|
26070
|
26071
|
26104
|
26653
|
26654
|
27140
|
27141
|
27142
|
27757
|
27758
|
27759
|
27760
|
27761
|
27900
|
27901
|
27902
|
27993
|
27995
|
34458
|
34459
|
34460
|
34461
|
34462
|
34463
|
36243
|
36244
|
36245
|
36246
|
36247
|
36248
|
36455
|
38533
|
38534
|
38535
|
38536
|
38537
|
38538
|
38539
|
40153
|
40154
|
40155
|
40543
|
40555
|
40556
|
40557
|
40558
|
40811
|
40812
|
40813
|
40814
|
40815
|
41425
|
41453
|
41476
|
42373
|
43261
|
43547
|
43614
|
43615
|
43616
|
43617
|
43618
|
43619
|
43620
|
43621
|
43622
|
43623
|
43703
|
43704
|
43705
|
43706
|
43707
|
43708
|
43709
|
43710
|
43711
|
43712
|
43713
|
43772
|
43790
|
43883
|
43969
|
44016
|
44018
|
44022
|
44023
|
44024
|
44025
|
44026
|
44027
|
44028
|
44029
|
44030
|
44031
|
44032
|
44033
|
44034
|
44035
|
44036