[Bug 44155] New: Z39.50 responder with Elasticsearch adds one more item status subfield each time a record is fetched again
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44155 Bug ID: 44155 Summary: Z39.50 responder with Elasticsearch adds one more item status subfield each time a record is fetched again Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Z39.50 / SRU / OpenSearch Servers Assignee: koha-bugs@lists.koha-community.org Reporter: adolfo.rodriguez@xercode.es QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Target Milestone: --- With Elasticsearch, the Z39.50 responder started with --add-item-status adds one more status subfield to the item fields each time the same record of the same result set is fetched. Koha::Z3950Responder::GenericSession->fetch_record keeps the MARC::Record objects of the result set in cached_results (20 records prefetched by default), and C4::Search::new_record_from_zebra returns them as they are with Elasticsearch. fetch_handler then calls add_item_status on the item fields of the cached object itself, so the status subfield stays in the cache. To reproduce (Elasticsearch): 1. perl misc/z3950_responder.pl --add-item-status=k tcp:@:9998 2. With yaz-client: open tcp:localhost:9998/biblios format xml elements marcxml find @attr 1=12 <biblionumber of a record with an available item> show 1 => 952 $k Available 3. Without closing yaz-client, mark the item as damaged and run "show 1" again => 952 $k Available $k Damaged The first status is no longer true, and without --add-status-multi-subfield there should be only one status subfield. A new search returns only $k Damaged. Zebra is not affected, because ZebraSession builds the record again from the XML on each fetch. This also affects clients that fetch the records of a result set again (paging back, or showing the records again). Found while testing bug 43943. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44155 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |adolfo.rodriguez@xercode.es |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44155 --- Comment #1 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 212009 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212009&action=edit Bug 44155: Do not add the item statuses to the cached records in the Z39.50 responder With Elasticsearch, Koha::Z3950Responder::GenericSession caches the MARC::Record objects of the result set, and fetch_handler adds the item status subfield (--add-item-status) to the cached object itself. Each new fetch of the same record of the same result set adds one more status subfield, and the statuses of the previous fetches stay in the record even when they are no longer true. This patch makes fetch_record return a copy of the cached record. Test plan: 1. Use Elasticsearch and start the Z39.50 responder with item statuses: perl misc/z3950_responder.pl --add-item-status=k tcp:@:9998 2. Pick a record with an available item, and with yaz-client: open tcp:localhost:9998/biblios format xml elements marcxml find @attr 1=12 <biblionumber> show 1 => The item field (952) has $k Available 3. Without closing yaz-client, mark the item as damaged in the staff interface, and run again: show 1 => The item field has two status subfields: $k Available and $k Damaged 4. Apply the patch, restart the responder, unmark the item as damaged and repeat steps 2 and 3 => The second show returns only $k Damaged 5. prove t/db_dependent/Koha/Z3950Responder/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44155 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43943 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org