Main Koha release repository https://koha-community.org
Find a file
Nick Clemens 2e23ed06b7
Bug 33270: Attempt to recover from invalid metadata exception
This patch uses the new record_strip_nonxml routine to attempt to display
the record when it contains invalid characters

Rather than silently strippg these, we warn in the logs, then add an 'about'
container to the response. It is displayed nicely in the web view or sent as "INVALID_METADATA" in
the xml response

The 'error' codes for OAI seem to be at the request level, and the offered codes don't have a match
for a bad record. Adding the about when we can recover seems the most generous response

To test:
Test plan, assumes using KTD default data - otherwise you need to find and import a record with encoding issues:
 1 - Enable OAI-PMH system preference
 2 - Browse to:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&resumptionToken=marcxml/350////0/0/352
 3 - 500 error:
    Invalid data, cannot decode metadata object (biblio_metadata.id=368, biblionumber=369, format=marcxml, schema=MARC21, decoding_error=':8: parser error : PCDATA invalid Char value 31...
 4 - Apply patch, restart all
 5 - Reload the page
 6 - It loads!
 7 - Click 'Metadata' for record 369 - it succeeds!
 8 - Check the logs - confirm you see a warning of the record problem
 9 - Confirm 369 has an about section
10 - Check the individul 'GetRecord' response as well
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=oai_dc&identifier=KOHA-OAI-TEST:369

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c71468537b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-19 09:27:43 +01:00
acqui Bug 34022: Adjust items data structure 2023-06-26 14:49:52 +02:00
admin Bug 34261: Add missing argument to show_account 2023-07-18 12:42:20 +01:00
api Bug 34211: Add +strings for GET /api/v1/biblios/:biblio_id/items 2023-07-18 12:26:05 +01:00
authorities Bug 33803: Remove comment about tab width 2023-06-09 11:22:17 -03:00
basket Bug 33223: Replace 'first_valid' with 'notice' for email addresses 2023-05-16 15:17:35 -03:00
bin
C4 Bug 34288: (follow-up) Tidy block 2023-07-19 08:32:47 +01:00
catalogue Bug 33047: Return 404 instead of 500 when biblio does not exist 2023-07-18 10:28:24 +01:00
cataloguing Bug 34288: Allow access to the cataloguing module with tools permission 2023-07-19 08:32:47 +01:00
circ Bug 34094: Use DefaultPatronSearchMethod consistently 2023-07-17 16:04:31 +01:00
clubs
course_reserves
debian Bug 33776: Additional default plugin repo in koha-conf-site.xml.in 2023-07-18 10:44:42 +01:00
docs Bug 33899: Add the 23.11 release team 2023-07-12 07:59:29 +01:00
erm
errors
etc Bug 34101: Limit items types that can be checked out via SIP2 2023-07-17 16:35:05 +01:00
ill
installer Bug 33720: Also flush in install 2023-07-17 15:50:30 +01:00
Koha Bug 33270: Attempt to recover from invalid metadata exception 2023-07-19 09:27:43 +01:00
koha-tmpl Bug 33270: Attempt to recover from invalid metadata exception 2023-07-19 09:27:43 +01:00
labels
lib/CGI/Session/Serialize
members Bug 34094: Use DefaultPatronSearchMethod consistently 2023-07-17 16:04:31 +01:00
misc Bug 18855: Don't create duplicate overdue fines if an issue is returned 2023-07-17 16:42:03 +01:00
offline_circ Bug 33961: Remove built-in offline circ tool 2023-07-17 08:18:59 +01:00
opac Bug 34218: Send a record copy to avoid loss of information and display problems 2023-07-18 10:33:14 +01:00
patron_lists
patroncards
plugins Bug 30367: (follow-up) Same adjustment for gitlab 2023-05-05 10:18:57 -03:00
pos
recalls Bug 34013: Recalls awaiting pickup doesn't show count on each tab 2023-07-17 14:51:00 +01:00
reports Bug 29664: (QA follow-up) Typo transacton 2023-07-17 15:58:47 +01:00
reserve Bug 30860: Cache CanItemBeReserved return value 2023-07-17 15:00:44 +01:00
reviews
rotating_collections
serials Bug 34146: Counterpart for serials-edit 2023-07-17 15:57:40 +01:00
services
skel
suggestion Bug 33236: Move NewSuggestion to Koha::Suggestion->store 2023-06-09 12:04:46 -03:00
svc Bug 33944: Don't fetch item object unless using recalls 2023-07-17 14:42:23 +01:00
t Bug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata 2023-07-19 09:27:43 +01:00
tags
tools Bug 33667: Allow copying holidays to all libraries when editing 2023-07-17 16:42:42 +01:00
virtualshelves Bug 33223: Fix sendshelf 2023-05-16 15:17:36 -03:00
xt Bug 30002: Remove unused xt/perltidyrc 2023-07-12 07:55:00 +01:00
.editorconfig
.eslintrc.json
.gitignore Bug 33710: Ignore how-to related files 2023-05-12 17:50:01 -03:00
.htaccess
.mailmap Update .mailmap 2023-07-17 08:12:22 +01:00
.perlcriticrc
.perltidyrc Bug 30002: Adjust perltidy 2023-07-12 07:55:00 +01:00
.proverc.dist
.stylelintrc.json
about.pl Bug 33934: Add more detail to 'No encryption_key in koha-conf.xml' 2023-06-09 12:05:00 -03:00
app.psgi
build-resources.PL
changelanguage.pl
cpanfile
cypress.json Bug 33408: Extend defaultCommandTimeout for cypress 2023-04-13 11:48:00 -03:00
fix-perl-path.PL
gulpfile.js
help.pl
INSTALL
Koha.pm Bug 34029: DBRev 23.05.01.003 2023-07-17 15:40:55 +01:00
koha_perl_deps.pl
kohaversion.pl
LICENSE
mainpage.pl
Makefile.PL Bug 26700: Remove occurrences in Makefile.PL 2023-07-17 11:01:46 +01:00
MANIFEST.SKIP
package.json
README
README.md
README.robots
rewrite-config.PL
tsconfig.json
webpack.config.js
yarn.lock

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo