Bug 22685 - Koha::Acquisition::Bookseller methods should return Koha::Objects using the DBIx::Class relationships
Summary: Koha::Acquisition::Bookseller methods should return Koha::Objects using the D...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 22686 (view as bug list)
Depends on:
Blocks: 22407
  Show dependency treegraph
 
Reported: 2019-04-11 09:05 UTC by Martin Renvoize
Modified: 2020-11-30 21:49 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 22685: Use DBIx::Class relationships in Koha::Acq::Bookseller methods (3.66 KB, patch)
2020-01-30 11:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22685: Use DBIx::Class relationships in Koha::Acq::Bookseller methods (3.71 KB, patch)
2020-02-05 20:16 UTC, David Nind
Details | Diff | Splinter Review
Bug 22685: Use DBIx::Class relationships in Koha::Acq::Bookseller methods (3.77 KB, patch)
2020-03-26 15:07 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2019-04-11 09:05:17 UTC
As the title says.. the relationship accessor passthrough here returns a plain dbic resultset rather than a Koha::Objects bassed object.
Comment 1 Jonathan Druart 2020-01-30 11:39:08 UTC
Created attachment 98157 [details] [review]
Bug 22685: Use DBIx::Class relationships in Koha::Acq::Bookseller methods

To match PERL15 we change the behavior of Koha::Object methods to make
them use the DBIx::Class relationships.

Test plan:
- Create a vendor, basket and contact
- Edit the vendor => the contact must appears
- Go to the view of a vendor => you cannot delete the vendor, it has
a basket attached
- Create another vendor, without basket
- Go to the view of the vendor => You can delete it

Additionally:
 % prove t/db_dependent/Koha/Acquisition/Booksellers.t
must return green
Comment 2 Jonathan Druart 2020-02-03 10:46:51 UTC
*** Bug 22686 has been marked as a duplicate of this bug. ***
Comment 3 David Nind 2020-02-05 20:16:41 UTC
Created attachment 98510 [details] [review]
Bug 22685: Use DBIx::Class relationships in Koha::Acq::Bookseller methods

To match PERL15 we change the behavior of Koha::Object methods to make
them use the DBIx::Class relationships.

Test plan:
- Create a vendor, basket and contact
- Edit the vendor => the contact must appears
- Go to the view of a vendor => you cannot delete the vendor, it has
a basket attached
- Create another vendor, without basket
- Go to the view of the vendor => You can delete it

Additionally:
 % prove t/db_dependent/Koha/Acquisition/Booksellers.t
must return green

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Martin Renvoize 2020-03-26 15:07:32 UTC
Created attachment 101868 [details] [review]
Bug 22685: Use DBIx::Class relationships in Koha::Acq::Bookseller methods

To match PERL15 we change the behavior of Koha::Object methods to make
them use the DBIx::Class relationships.

Test plan:
- Create a vendor, basket and contact
- Edit the vendor => the contact must appears
- Go to the view of a vendor => you cannot delete the vendor, it has
a basket attached
- Create another vendor, without basket
- Go to the view of the vendor => You can delete it

Additionally:
 % prove t/db_dependent/Koha/Acquisition/Booksellers.t
must return green

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2020-03-26 15:07:59 UTC
Works as expected, passes QA script and is an obvious improvement.. Passing QA
Comment 6 Martin Renvoize 2020-03-27 08:53:31 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Joy Nelson 2020-04-03 22:46:49 UTC
enhancement not backported to 19.11.x