Bugzilla – Attachment 157402 Details for
Bug 34014
There is no way to fix records with broken MARCXML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34014: Add support for advanced cataloging editor
Bug-34014-Add-support-for-advanced-cataloging-edit.patch (text/plain), 2.94 KB, created by
Martin Renvoize (ashimema)
on 2023-10-19 09:33:09 UTC
(
hide
)
Description:
Bug 34014: Add support for advanced cataloging editor
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-10-19 09:33:09 UTC
Size:
2.94 KB
patch
obsolete
>From e014334311f0fe8e13be3f997abea595b9e2b2dd Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 17 Oct 2023 17:06:22 +0000 >Subject: [PATCH] Bug 34014: Add support for advanced cataloging editor > >To test: >1 - Enable the advanced cataloging editor >2 - Edit record 369 in the advanced cataloging editor >3 - On load, get a notice that there were issues and to check logs >4 - Save record >5 - Close and reopen in editor >6 - Confirm warning is gone > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../lib/koha/cateditor/koha-backend.js | 6 +++++- > svc/bib | 13 +++++++++++-- > 2 files changed, 16 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js >index d3556bbc1ab..934c7fb4f4b 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js >@@ -106,7 +106,11 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin > GetRecord: function( id, remove_control_num, callback ) { > $.get( > '/cgi-bin/koha/svc/bib/'+ id >- ).done( function( metadata ) { >+ ).done( function( metadata, status, xhr ) { >+ let encoding_issues = xhr.getResponseHeader('invalid-metadata'); >+ if( encoding_issues ){ >+ humanMsg.displayAlert( _("Record had encoding issues, please see logs") ); >+ } > $.get( > '/cgi-bin/koha/svc/bib_framework/' + id > ).done( function( frameworkcode ) { >diff --git a/svc/bib b/svc/bib >index d25d0710c6a..fc5996168d8 100755 >--- a/svc/bib >+++ b/svc/bib >@@ -67,9 +67,18 @@ sub fetch_bib { > my $query = shift; > my $biblionumber = shift; > my $biblio = Koha::Biblios->find( $biblionumber ); >- my $record = $biblio->metadata->record({ embed_items => scalar $query->param('items') }); >+ my $record; >+ my $exception; >+ my $invalid_metadata; >+ eval { $record = $biblio->metadata->record({ embed_items => scalar $query->param('items') }) }; >+ if( $@ ){ >+ $exception = $@; >+ $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') ); >+ $record = $biblio->metadata->record_strip_nonxml({ embed_items => scalar $query->param('items') }); >+ $invalid_metadata = 1; >+ } > if (defined $record) { >- print $query->header(-type => 'text/xml',-charset => 'utf-8',); >+ print $query->header(-type => 'text/xml',-charset => 'utf-8', -invalid_metadata => $invalid_metadata ); > print $record->as_xml_record(); > } else { > print $query->header(-type => 'text/xml', -status => '404 Not Found'); >-- >2.41.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 34014
:
152360
|
157274
|
157275
|
157276
|
157277
|
157280
|
157401
| 157402 |
157403
|
157404
|
157405