Bug 27149 - Z3950Responder removes itemnumber when adding item statuses
Summary: Z3950Responder removes itemnumber when adding item statuses
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on: 13937
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-03 16:56 UTC by Nick Clemens
Modified: 2021-12-13 21:08 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02,20.05.08


Attachments
Bug 27149: Unit tests (3.17 KB, patch)
2020-12-03 17:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder (1.76 KB, patch)
2020-12-03 17:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27149: Unit tests (2.15 KB, patch)
2020-12-07 12:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder (1.76 KB, patch)
2020-12-07 12:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27149: Unit tests (2.21 KB, patch)
2020-12-11 08:31 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder (1.82 KB, patch)
2020-12-11 08:32 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 27149: Unit tests (2.27 KB, patch)
2021-01-11 12:33 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder (1.89 KB, patch)
2021-01-11 12:33 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder (1.97 KB, patch)
2021-01-12 10:34 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-12-03 16:56:55 UTC
Koha/Z3950Responder/Session.pm:
297     $field->delete_subfield( code => $itemnumber_subfield );


This breaks MARCEdit integration as svc/bib uses the itemnumber field to update items
Comment 1 Nick Clemens 2020-12-03 17:09:29 UTC
Created attachment 114155 [details] [review]
Bug 27149: Unit tests
Comment 2 Nick Clemens 2020-12-03 17:09:31 UTC
Created attachment 114156 [details] [review]
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder

To test:
1 - sudo koha-z3950-responder --stop kohadev
2 - Run it manually:
    perl /kohadevbox/koha/misc/z3950_responder.pl -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
3 - Connect and search to verify itemnumber is in item records
    yaz-client localhost:2100
    base biblios
    find shuffle
    show 1+1
4 - sudo koha-z3950-responder --stop kohadev
5 - Run it manually to add item status
    perl /kohadevbox/koha/misc/z3950_responder.pl --add-item-status k -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
6 - Connect and search, no itemnumber in records
7 - Apply patch
8 - Stop, restart all the things, and manually start server with item status again
9 - Connect and search, itemnumbers are included
Comment 3 Fridolin Somers 2020-12-07 12:32:09 UTC
Sorry Bug 27149: Unit tests does not apply on current master.
Comment 4 Fridolin Somers 2020-12-07 12:34:56 UTC
Main patch works.
I see no reason to strip itemnumber from item fields.
Comment 5 Nick Clemens 2020-12-07 12:47:08 UTC
Created attachment 114230 [details] [review]
Bug 27149: Unit tests
Comment 6 Nick Clemens 2020-12-07 12:47:10 UTC
Created attachment 114231 [details] [review]
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder

To test:
1 - sudo koha-z3950-responder --stop kohadev
2 - Run it manually:
    perl /kohadevbox/koha/misc/z3950_responder.pl -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
3 - Connect and search to verify itemnumber is in item records
    yaz-client localhost:2100
    base biblios
    find shuffle
    show 1+1
4 - sudo koha-z3950-responder --stop kohadev
5 - Run it manually to add item status
    perl /kohadevbox/koha/misc/z3950_responder.pl --add-item-status k -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
6 - Connect and search, no itemnumber in records
7 - Apply patch
8 - Stop, restart all the things, and manually start server with item status again
9 - Connect and search, itemnumbers are included
Comment 7 Fridolin Somers 2020-12-11 08:31:48 UTC
Created attachment 114320 [details] [review]
Bug 27149: Unit tests

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 8 Fridolin Somers 2020-12-11 08:32:02 UTC
Created attachment 114321 [details] [review]
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder

To test:
1 - sudo koha-z3950-responder --stop kohadev
2 - Run it manually:
    perl /kohadevbox/koha/misc/z3950_responder.pl -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
3 - Connect and search to verify itemnumber is in item records
    yaz-client localhost:2100
    base biblios
    find shuffle
    show 1+1
4 - sudo koha-z3950-responder --stop kohadev
5 - Run it manually to add item status
    perl /kohadevbox/koha/misc/z3950_responder.pl --add-item-status k -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
6 - Connect and search, no itemnumber in records
7 - Apply patch
8 - Stop, restart all the things, and manually start server with item status again
9 - Connect and search, itemnumbers are included

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 9 Martin Renvoize 2021-01-11 12:33:08 UTC
Created attachment 115017 [details] [review]
Bug 27149: Unit tests

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2021-01-11 12:33:11 UTC
Created attachment 115018 [details] [review]
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder

To test:
1 - sudo koha-z3950-responder --stop kohadev
2 - Run it manually:
    perl /kohadevbox/koha/misc/z3950_responder.pl -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
3 - Connect and search to verify itemnumber is in item records
    yaz-client localhost:2100
    base biblios
    find shuffle
    show 1+1
4 - sudo koha-z3950-responder --stop kohadev
5 - Run it manually to add item status
    perl /kohadevbox/koha/misc/z3950_responder.pl --add-item-status k -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
6 - Connect and search, no itemnumber in records
7 - Apply patch
8 - Stop, restart all the things, and manually start server with item status again
9 - Connect and search, itemnumbers are included

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2021-01-11 12:33:30 UTC
Works as expected.. Passing QA
Comment 12 Jonathan Druart 2021-01-12 10:34:29 UTC
Created attachment 115063 [details] [review]
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder

This breaks MARCEdit integration as svc/bib uses the itemnumber field to update items

To test:
1 - sudo koha-z3950-responder --stop kohadev
2 - Run it manually:
    perl /kohadevbox/koha/misc/z3950_responder.pl -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
3 - Connect and search to verify itemnumber is in item records
    yaz-client localhost:2100
    base biblios
    find shuffle
    show 1+1
4 - sudo koha-z3950-responder --stop kohadev
5 - Run it manually to add item status
    perl /kohadevbox/koha/misc/z3950_responder.pl --add-item-status k -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
6 - Connect and search, no itemnumber in records
7 - Apply patch
8 - Stop, restart all the things, and manually start server with item status again
9 - Connect and search, itemnumbers are included

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Jonathan Druart 2021-01-12 10:43:12 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 14 Fridolin Somers 2021-01-14 16:31:38 UTC
Pushed to 20.11.x for 20.11.02
Comment 15 Andrew Fuerste-Henry 2021-01-22 16:32:21 UTC
Pushed to 20.05.x for 20.05.08
Comment 16 Victor Grousset/tuxayo 2021-01-22 20:59:33 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.