https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44155

--- Comment #1 from Adolfo Rodríguez Taboada <[email protected]> ---
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.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to