[Bug 7729] New: svc API should allow creation and deletion of items
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Priority: P5 - low Change sponsored?: Sponsored Bug ID: 7729 Assignee: mjr@ttllp.co.uk Summary: svc API should allow creation and deletion of items QA Contact: koha.sekjal@gmail.com Severity: enhancement Classification: Unclassified OS: All Reporter: mjr@ttllp.co.uk URL: http://koha:8080/svc/biblio Hardware: All Status: ASSIGNED Version: unspecified Component: Architecture, internals, and plumbing Product: Koha The svc new_biblio and biblio scripts delete items, but it's not clear why. Item creation over svc is a desirable option. The svc API should also support deletion of items - maybe using HTTP DELETE method. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 MJ Ray (software.coop) <mjr@ttllp.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|svc API should allow |svc API should allow |creation and deletion of |modification of items |items | --- Comment #1 from MJ Ray (software.coop) <mjr@ttllp.co.uk> --- OK, some developments: 1. I convinced the library that it would be better to modify the items to set a state of withdrawn, rather than delete them (because it preserves circulation logs and so on); 2. Bug 7613 will allow creation of items through import_bib; so I am retitling this bug and a patch will be attached as soon as I've finished reviewing it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 --- Comment #2 from MJ Ray (software.coop) <mjr@ttllp.co.uk> --- Created attachment 8540 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8540&action=edit svc/bib: support appending ?items=1 to the URL to fetch or modify items -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 MJ Ray (software.coop) <mjr@ttllp.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #3 from Chris Cormack <chris@bigballofwax.co.nz> --- Patch applies cleanly, and now works with the new architecture where Items are separate to Biblio data ans should be handled as such. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 --- Comment #4 from Chris Cormack <chris@bigballofwax.co.nz> --- http://koha:8080/cgi-bin/koha/svc/bib/1 <?xml version="1.0" encoding="UTF-8"?> <record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"> <leader>00118nam a22000617a 4500</leader> <controlfield tag="008">120321b xxu||||| |||| 00| 0 eng d</controlfield> <datafield tag="245" ind1=" " ind2=" "> <subfield code="a">w</subfield> </datafield> <datafield tag="999" ind1=" " ind2=" "> <subfield code="c">1</subfield> <subfield code="d">1</subfield> </datafield> </record> http://koha:8080/cgi-bin/koha/svc/bib/1?items=1 <record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"> <leader>00118nam a22000617a 4500</leader> <controlfield tag="008">120321b xxu||||| |||| 00| 0 eng d</controlfield> <datafield tag="245" ind1=" " ind2=" "> <subfield code="a">w</subfield> </datafield> <datafield tag="999" ind1=" " ind2=" "> <subfield code="c">1</subfield> <subfield code="d">1</subfield> </datafield> <datafield tag="952" ind1=" " ind2=" "> <subfield code="w">2012-03-21</subfield> <subfield code="p">1</subfield> <subfield code="r">2012-03-21</subfield> <subfield code="4">0</subfield> <subfield code="0">0</subfield> <subfield code="9">1</subfield> <subfield code="b">MPL</subfield> <subfield code="1">0</subfield> <subfield code="d">2012-03-21</subfield> <subfield code="7">0</subfield> <subfield code="2">ddc</subfield> <subfield code="s">2012-03-21</subfield> <subfield code="l">2</subfield> <subfield code="a">MPL</subfield> </datafield> </record> GET Works as advertised -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #8540|0 |1 is obsolete| | --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 8544 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8544&action=edit Bug 7729 : svc/bib: support appending ?items=1 to the URL to fetch or modify items Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |jonathan.druart@biblibre.co | |m --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- QA Comments: perlcritic OK (scv/bib) Test on an UNIMARC installation, the patch add a node 995 per item. Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.poulain@biblibre.com --- Comment #7 from Paul Poulain <paul.poulain@biblibre.com> --- QA comment: another question: The code says: + my $fullrecord = $record->clone(); then a few lines later: - foreach my $field ($record->field($itemtag)) { + foreach my $field ( $record->field($itemtag) ) { $record->delete_field($field); } then + foreach my $field ( $fullrecord->field($itemtag) ) { + my $one_item_record = $record->clone(); + $one_item_record->add_fields($field); + ModItemFromMarc( $one_item_record, $biblionumber, + $field->subfield($itemsubfield) ); + } so= we clone the record, remove items from old record if there are, then reintroduce item in the new record. Shouldn't we have - foreach my $field ($record->field($itemtag)) { + foreach my $field ( $fullrecord->field($itemtag) ) { $record->delete_field($field); } ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #8 from Paul Poulain <paul.poulain@biblibre.com> --- MJ, please answer to my comment 7 question and switch back to "passed QA" if it's not a bug, or provide a follow-up (and back to passed QA, as it should be a trivial folluw-up) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 MJ Ray (software.coop) <mjr@ttllp.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA --- Comment #9 from MJ Ray (software.coop) <mjr@ttllp.co.uk> --- Pasting the reply that I emailed in and it never appeared: Could you explain the benefit of using $fullrecord in the foreach that deletes from $record, please? My fear is that if future new code between the clone and the delete extend $fullrecord somehow, then deleting all $fullrecord's fields from $record could raise an error. The reason why we readd the item details into $one_item_record is that tests suggested ModItemFromMarc only accepts records with one item, so we send it item-containing records one at a time. It might be more efficient to delete the just-added item and recycle $one_item_record, rather than clone the item-less $record each time: I've not tested it and felt it was probably safest to use a new clone. Thanks for considering this enhancement. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #10 from Paul Poulain <paul.poulain@biblibre.com> --- (In reply to comment #9)
Pasting the reply that I emailed in and it never appeared:
I'm not sure I understand your answer, but I'm not sure I can explain clearly my concern either. So pushing, please everybody double check to be sure there's no problem -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |rel_3_8 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 --- Comment #11 from MJ Ray (software.coop) <mjr@software.coop> --- Created attachment 9182 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9182&action=edit svc/new_bib: support ?items=1 to add POSTed items to the new biblio too -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 MJ Ray (software.coop) <mjr@software.coop> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |ASSIGNED --- Comment #12 from MJ Ray (software.coop) <mjr@software.coop> --- follow-up patch posted to extend new_bib in a similar way, adding support for ?items=1 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 MJ Ray (software.coop) <mjr@software.coop> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 --- Comment #13 from Paul Poulain <paul.poulain@biblibre.com> --- (In reply to comment #12)
follow-up patch posted to extend new_bib in a similar way, adding support for ?items=1
MJ, the attachment Bug 7729 : svc/bib: support appending ?items=1 to the URL to fetch or modify items (2.41 KB, patch) has been pushed, right ? So only the follow-up is requiring signoff now ? if i'm right please obsolet the 1st patch (Detail on the right of the patch, then "Edit Detail" link -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 MJ Ray (software.coop) <mjr@software.coop> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #8544|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #9182|0 |1 is obsolete| | --- Comment #14 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 10738 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10738&action=edit Bug 7729 : svc/new_bib: support ?items=1 to add POSTed items to the new biblio too Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |mtj@kohaaloha.com QA Contact|koha.sekjal@gmail.com |mtj@kohaaloha.com --- Comment #15 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #14)
Created attachment 10738 [details] Bug 7729 : svc/new_bib: support ?items=1 to add POSTed items to the new biblio too
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
passing QA... looks good $ koha-qa.pl - a3b7e27 Bug 7729 : svc/new_bib: support ?items=1 to add POSTed items to the new biblio too svc/new_bib - perlcritic-progressive tests... OK - perl -c syntax tests... OK - xt/tt_valid.t tests... OK - xt/author/vaild-template.t tests... OK -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7729 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master Version|rel_3_8 |rel_3_10 --- Comment #16 from Paul Poulain <paul.poulain@biblibre.com> --- Maybe it's worth backporting to 3.8 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org