[Bug 24366] New: Merging biblioitems should happen in Koha::Biblio->to_api
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Bug ID: 24366 Summary: Merging biblioitems should happen in Koha::Biblio->to_api Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com Now we can embed objects, we need to make sure the JSON representation of a biblio object (which includes information from biblioitems) is generated in Koha::Biblio->to_api instead of the API controller. -- 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=24366 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Depends on| |24228 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 [Bug 24228] Add a parameter to recursively embed objects in Koha::Object(s)->to_api -- 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=24366 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 96914 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96914&action=edit Bug 24366: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 96915 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96915&action=edit Bug 24366: Merge biblioitem in Koha::Biblio->to_api This patch moves the bilbioitem object merge into the Koha::Biblio->to_api method, as opposed to doing it in the controller. This is an inevitable change as other endpoints might require to embed biblio objects, and they need to carry the biblioitem information. Also, if we merge the tables, the transition will be straightforward (remove the tests this patch introduces, and merge the mappings from Koha::Biblioitem into Koha::Biblio). To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t \ t/db_dependent/api/v1/biblios.t => SUCCESS: Tests pass! i.e. the new to_api method is tested, and the API tests don't expect any behavior change. 3. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |20212 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20212 [Bug 20212] Slowness in Receiving in Acquisitions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96914|0 |1 is obsolete| | Attachment #96915|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 96958 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96958&action=edit Bug 24366: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 96959 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96959&action=edit Bug 24366: Merge biblioitem in Koha::Biblio->to_api This patch moves the bilbioitem object merge into the Koha::Biblio->to_api method, as opposed to doing it in the controller. This is an inevitable change as other endpoints might require to embed biblio objects, and they need to carry the biblioitem information. Also, if we merge the tables, the transition will be straightforward (remove the tests this patch introduces, and merge the mappings from Koha::Biblioitem into Koha::Biblio). To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t \ t/db_dependent/api/v1/biblios.t => SUCCESS: Tests pass! i.e. the new to_api method is tested, and the API tests don't expect any behavior change. 3. Sign off :-D Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96958|0 |1 is obsolete| | Attachment #96959|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 97312 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97312&action=edit Bug 24366: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 97313 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97313&action=edit Bug 24366: Merge biblioitem in Koha::Biblio->to_api This patch moves the bilbioitem object merge into the Koha::Biblio->to_api method, as opposed to doing it in the controller. This is an inevitable change as other endpoints might require to embed biblio objects, and they need to carry the biblioitem information. Also, if we merge the tables, the transition will be straightforward (remove the tests this patch introduces, and merge the mappings from Koha::Biblioitem into Koha::Biblio). To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t \ t/db_dependent/api/v1/biblios.t => SUCCESS: Tests pass! i.e. the new to_api method is tested, and the API tests don't expect any behavior change. 3. Sign off :-D Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 97314 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97314&action=edit Bug 24366: Improve hashref construction Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 97332 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97332&action=edit Bug 24366: Make sure accessors are used on the right object This patch makes the Koha::Biblio->to_api method try the accessors on $self first, and fallback to $self->biblioitem on those he can't. This way it won't happen that (for example) ->holds will be tried against ->biblioitem. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24554 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24554 [Bug 24554] Only embed relations from Koha::Biblio in to_api -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com --- Comment #10 from Joy Nelson <joy@bywatersolutions.com> --- Does not apply to 19.11.x branch. Please rebase if needed for 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED --- Comment #11 from Joy Nelson <joy@bywatersolutions.com> --- not pushed to 19.11.x due to dependencies -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org