The current implemented behaviour of this method (fallback to the biblioitems relations) breaks using it with bug 24538. On fixing it, I noticed the method is quite over-engineered. As biblioitems is not a real entity on the API and we are not going to add related tables to bilbioitems (most probably get it merged into biblio) we don't need the pass-through of embeds into the biblioitem object. This makes counts work, and also makes sense :-D
Created attachment 98225 [details] [review] Bug 24554: Only embed relations from Koha::Biblio in to_api This patch simplifies the behaviour of Koha::Biblio->to_api. It was designed with the idea of handling possible methods that would be added to Koha::Biblioitem. But it had a weird fallback behaviour was highlighted by using it with bug 24528. On fixing it it become obvious that it was unnessessarily complex and that it was not worth. That's the reason there wasn't any test for it, as Koha::Biblioitem doesn't implement any extra methods. To test: 1. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat (1) => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 98266 [details] [review] Bug 24554: Only embed relations from Koha::Biblio in to_api This patch simplifies the behaviour of Koha::Biblio->to_api. It was designed with the idea of handling possible methods that would be added to Koha::Biblioitem. But it had a weird fallback behaviour was highlighted by using it with bug 24528. On fixing it it become obvious that it was unnessessarily complex and that it was not worth. That's the reason there wasn't any test for it, as Koha::Biblioitem doesn't implement any extra methods. To test: 1. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat (1) => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 98519 [details] [review] Bug 24554: Only embed relations from Koha::Biblio in to_api This patch simplifies the behaviour of Koha::Biblio->to_api. It was designed with the idea of handling possible methods that would be added to Koha::Biblioitem. But it had a weird fallback behaviour was highlighted by using it with bug 24528. On fixing it it become obvious that it was unnessessarily complex and that it was not worth. That's the reason there wasn't any test for it, as Koha::Biblioitem doesn't implement any extra methods. To test: 1. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat (1) => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nice work everyone! Pushed to master for 20.05
Not pushed to 19.11.x due to dependencies