Created attachment 124635 [details] [review] Bug 28965: filter_by_public() and filter_by_readable() This patch adds helper methods for lists resultsets. Tests are added for their behavior. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Virtualshelves.t => SUCCESS: Tests pass! 3. Sign off :-D
Created attachment 124636 [details] [review] Bug 28965: Add /public/lists This patch adds a route for publicly retrieving lists.
Submitting early to highlight the coolness of what we did on bug 28948. It still needs tests. I will file a separate bug for all the CRUD (staff/public). The barebones are done anyway :-D
Tests fail for me after applying patch (and dependencies) 8-(... root@kohadevbox:koha(bz28965)$ prove t/db_dependent/Virtualshelves.t t/db_dependent/Virtualshelves.t .. No method count found for Koha::Virtualshelves DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'public' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 601 at /kohadevbox/koha/Koha/Virtualshelf.pm line 99. DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'public' in 'field list' at /kohadevbox/koha/Koha/Object.pm line 170 # Looks like you planned 13 tests but ran 1. t/db_dependent/Virtualshelves.t .. 1/8 # Failed test 'CRUD' # at t/db_dependent/Virtualshelves.t line 110. DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'public' in 'field list' at /kohadevbox/koha/Koha/Object.pm line 170 # Looks like your test exited with 11 just after 1. t/db_dependent/Virtualshelves.t .. Dubious, test returned 11 (wstat 2816, 0xb00) Failed 8/8 subtests Test Summary Report ------------------- t/db_dependent/Virtualshelves.t (Wstat: 2816 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 11 Parse errors: Bad plan. You planned 8 tests but ran 1. Files=1, Tests=1, 2 wallclock secs ( 0.02 usr 0.00 sys + 1.58 cusr 0.15 csys = 1.75 CPU) Result: FAIL
(In reply to David Nind from comment #4) > Tests fail for me after applying patch (and dependencies) 8-(... > > root@kohadevbox:koha(bz28965)$ prove t/db_dependent/Virtualshelves.t > t/db_dependent/Virtualshelves.t .. No method count found for > Koha::Virtualshelves DBIx::Class::Storage::DBI::_dbh_execute(): DBI > Exception: DBD::mysql::st execute failed: Unknown column 'public' in 'where > clause' at /kohadevbox/koha/Koha/Objects.pm line 601 This failure is because you didn't run the updatedatabase script with bug 28959 applied. That said, I found some missing bits on that bug as well. So hold on.
(In reply to Tomás Cohen Arazi from comment #5) > This failure is because you didn't run the updatedatabase script with bug > 28959 applied. That said, I found some missing bits on that bug as well. So > hold on. Now that the dependencies are pushed, what else needs to be done to move this into Needs Signoff?
*** Bug 34577 has been marked as a duplicate of this bug. ***
Seems like there's a few of us keen on this one. Let's get this one in? I'm hoping to tackle bug 18148 before the end of the year, but it relies on having a public list endpoint.
Created attachment 165976 [details] [review] Bug 28965: filter_by_public() and filter_by_readable() This patch adds helper methods for lists resultsets. Tests are added for their behavior. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Virtualshelves.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 165977 [details] [review] Bug 28965: Add /public/lists This patch adds a route for publicly retrieving lists. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I've rebased this and got it passing QA scripts.. however it needs a good testing and QA run.
Still applies.. would be nice to see someone QA it soon.
(In reply to Martin Renvoize (ashimema) from comment #12) > Still applies.. would be nice to see someone QA it soon. I've got quite the backlog at the moment, but since this blocks bug 18148 it's definitely on my radar.
I know I'm being slow on this one, but this is one of those ones I'm really going to do at some point, as it relates to a customer request. I figure November/December timeline. Hopefully sooner rather than later but we'll see...
Created attachment 173624 [details] [review] Bug 28965: filter_by_public() and filter_by_readable() This patch adds helper methods for lists resultsets. Tests are added for their behavior. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Virtualshelves.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 173625 [details] [review] Bug 28965: Add /public/lists This patch adds a route for publicly retrieving lists. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 173626 [details] [review] Bug 28965: (QA follow-up) Fix misc qa issues * Tidy code * Fix number of unit tests * Remove unecessary use of delete Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Tomas, can you add api unit tests?
Created attachment 173627 [details] [review] Bug 28965: (QA follow-up) Fix misc qa issues * Tidy code * Fix number of unit tests * Fix use of delete Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(In reply to Kyle M Hall (khall) from comment #18) > Tomas, can you add api unit tests? Oops. Sure!
Created attachment 173687 [details] [review] Bug 28965: filter_by_public() and filter_by_readable() This patch adds helper methods for lists resultsets. Tests are added for their behavior. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Virtualshelves.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 173688 [details] [review] Bug 28965: Add /public/lists This patch adds a route for publicly retrieving lists. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 173689 [details] [review] Bug 28965: (QA follow-up) Fix misc qa issues * Tidy code * Fix number of unit tests * Fix use of delete Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 173690 [details] [review] Bug 28965: Unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(In reply to Kyle M Hall (khall) from comment #18) > Tomas, can you add api unit tests? Done, please review the changes and let me know if there's something else missing. Thanks!
Created attachment 173780 [details] [review] Bug 28965: filter_by_public() and filter_by_readable() This patch adds helper methods for lists resultsets. Tests are added for their behavior. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Virtualshelves.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 173781 [details] [review] Bug 28965: Add /public/lists This patch adds a route for publicly retrieving lists. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 173782 [details] [review] Bug 28965: (QA follow-up) Fix misc qa issues * Tidy code * Fix number of unit tests * Fix use of delete Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 173783 [details] [review] Bug 28965: Unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
All looking good here now, thanks :)
Pushed for 24.11! Well done everyone, thank you!
API not covered in the manual, so no updates required.