View | Details | Raw Unified | Return to bug 11559
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-record.js (+11 lines)
Lines 244-249 define( function() { Link Here
244
            // happens before UTF-8 encoding, but that won't cause any issues.
244
            // happens before UTF-8 encoding, but that won't cause any issues.
245
            data = _encode_utf8(data.substr(0, parseInt(data.substr(0, 5))));
245
            data = _encode_utf8(data.substr(0, parseInt(data.substr(0, 5))));
246
246
247
            // For now, we can't decode MARC-8, so just mark the record as possibly corrupted.
248
            if (data[9] != 'a') {
249
                var marc8 = true;
250
            }
251
247
            this._fieldlist.length = 0;
252
            this._fieldlist.length = 0;
248
            this.leader(data.substr(0, 24));
253
            this.leader(data.substr(0, 24));
249
            var directory_len = parseInt(data.substring(12, 17), 0) - 25,
254
            var directory_len = parseInt(data.substring(12, 17), 0) - 25,
Lines 254-259 define( function() { Link Here
254
                    len = parseInt(data.substring(off+3, off+7), 0) - 1,
259
                    len = parseInt(data.substring(off+3, off+7), 0) - 1,
255
                    pos = parseInt(data.substring(off+7, off+12), 0) + 25 + directory_len,
260
                    pos = parseInt(data.substring(off+7, off+12), 0) + 25 + directory_len,
256
                    value = data.substring(pos, pos+len);
261
                    value = data.substring(pos, pos+len);
262
263
                // No end-of-field character before this field, corruption!
264
                if (marc8 && data[pos - 1] != '\x1E') {
265
                    this.marc8_corrupted = true;
266
                }
267
257
                if ( parseInt(tag) < 10 ) {
268
                if ( parseInt(tag) < 10 ) {
258
                    this.addField( new MARC.Field( tag, '', '', [ [ '@', value ] ] ) );
269
                    this.addField( new MARC.Field( tag, '', '', [ [ '@', value ] ] ) );
259
                } else {
270
                } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-1 / +2 lines)
Lines 909-914 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
909
                            return;
909
                            return;
910
                        }
910
                        }
911
911
912
                        if (record.marc8_corrupted) humanMsg.displayMsg( '<h3>' + _("Possible record corruption") + '</h3><p>' + _("Record not marked as UTF-8, may be corrupted") + '</p>', { className: 'humanError' } );
913
912
                        editor.displayRecord( record );
914
                        editor.displayRecord( record );
913
                    };
915
                    };
914
916
915
- 

Return to bug 11559