Summary: | Malformed records shown as not existing | ||
---|---|---|---|
Product: | Koha | Reporter: | Magnus Enger <magnus> |
Component: | MARC Bibliographic data support | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | pablo.bianchi |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: |
Description
Magnus Enger
2022-02-08 10:46:16 UTC
SQL to find and fix records with an empty 942 field: SELECT biblionumber, timestamp, ExtractValue( metadata, 'count( //datafield[@tag="942"] )' ) AS count_fields, ExtractValue( metadata, 'count( //datafield[@tag="942"]/* )' ) AS count_subfields FROM biblio_metadata HAVING count_fields > 0 AND count_subfields = 0; UPDATE biblio_metadata SET metadata = UpdateXML( metadata, '//datafield[@tag="942"]', '' ) WHERE biblionumber IN ( x,y,z ); We get "The record you requested does not exist ()." on a record we can't reach by searching, only directly. Enger's query does't return any results. Searching the logs I found that with that particular biblio: > AH01215: Use of uninitialized value in join or string at /usr/share/koha/lib/Koha/Item.pm line 1043.: /usr/share/koha/intranet/cgi-bin/cataloguing/additem.pl, referer: https://mykoha/cgi-bin/koha/cataloguing/additem.pl?biblionumber=51135 Although [that line](https://github.com/Koha-Community/Koha/blob/22.05.x/Koha/Item.pm#L1043) is only for display purpose only, seems related with custom subfields, and we found a lot of issues having 952 with other custom subfields (..., y, z, α, β, γ). |