[Bug 26297] New: RestAPI : add a route to list patrons categories
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Bug ID: 26297 Summary: RestAPI : add a route to list patrons categories Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: arthur.suzuki@biblibre.com This is needed to implement self-registration in frontends softwares. Because POST to /api/v1/patrons need the category as a mandatory argument, we need a way to retrieve a list of the categories. -- 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=26297 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|RestAPI : add a route to |Rest API: add a route to |list patrons categories |list patron categories -- 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=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com, | |pedro.amorim@ptfs-europe.co | |m, tomascohen@gmail.com Assignee|koha-bugs@lists.koha-commun |pedro.amorim@ptfs-europe.co |ity.org |m -- 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=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35539 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #1 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 159714 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159714&action=edit Bug 26297: Preparation: Add dateofbirthrequired as boolean in Result/Schema -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #2 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 159715 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159715&action=edit Bug 26297: Add patron categories to_api_mapping -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #3 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 159716 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159716&action=edit Bug 26297: API specs Test plan, k-t-d: 1) Access /api/v1/patron_categories 2) Verify the patron categories are correctly listed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #4 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Missing tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159716|0 |1 is obsolete| | --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 159717 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159717&action=edit Bug 26297: API specs Test plan, k-t-d: 1) Access /api/v1/patron_categories 2) Verify the patron categories are correctly listed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #6 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 159722 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159722&action=edit Bug 26297: Add tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Lucas Gass <lucas@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=26297 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159714|0 |1 is obsolete| | --- Comment #7 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 159921 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159921&action=edit Bug 26297: Preparation: Add dateofbirthrequired as boolean in Result/Schema Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159715|0 |1 is obsolete| | --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 159922 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159922&action=edit Bug 26297: Add patron categories to_api_mapping Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159717|0 |1 is obsolete| | --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 159923 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159923&action=edit Bug 26297: API specs Test plan, k-t-d: 1) Access /api/v1/patron_categories 2) Verify the patron categories are correctly listed Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159722|0 |1 is obsolete| | --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 159924 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159924&action=edit Bug 26297: Add tests Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Should + dateofbirthrequired => 'date_of_birth_required', not be undef as well? I don't believe this is used. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #12 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Katrin Fischer from comment #11)
Should
+ dateofbirthrequired => 'date_of_birth_required',
not be undef as well? I don't believe this is used.
git grep dateofbirthrequired Shows quite a lot of hits, it certainly appears to be used. The SQL comment is "the minimum age required for the patron category" which I think is what this is used for, but the naming is not clear in that regard imo. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Pedro Amorim from comment #12)
(In reply to Katrin Fischer from comment #11)
Should
+ dateofbirthrequired => 'date_of_birth_required',
not be undef as well? I don't believe this is used.
git grep dateofbirthrequired
Shows quite a lot of hits, it certainly appears to be used. The SQL comment is "the minimum age required for the patron category" which I think is what this is used for, but the naming is not clear in that regard imo.
Yes, naming is terrible. We should rename it to something sensible in the API. Does something like "Lower_age_limit" work in English? We should make it clear that those fields belong together. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #14 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 159955 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159955&action=edit Bug 26297: (QA Follow-up); Rename dateofbirthrequired from date_of_birth_required to lower_age_limit in api_mapping -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159921|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #15 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Katrin, thank you, I agree. A couple notes: 1) I have made the following patch obsolete: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159714 I was thrown off by the naming and tinyint(1) in kohastructure and thought this column was meant to be a boolean indicating whether date of birth was supposed to be required or not. This is not the case, as we've established. 2) My understanding is that we're reluctant to fix things in the database due to existing reports, but it doesn't feel great to have to_api_mapping be fixing stuff that should really be fixed at the root of the problem. This specific naming is originally from 17 years ago, it's outdated, doesn't make sense and it should be fixed directly in the database structure imo. I'm going off on an tangent but I believe this is relevant. On a different bug I submitted this patch: https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=35570&attachment=159944 That atomicupdate will search for SQL reports containing the obsolete naming and notify, on upgrade, if some reports need to be manually looked at (and which). I wonder if we could adopt something like this going forward, and become a bit more open to updating and fixing the database schema. Note that all of the above is discussion only and should not block this bug 26297 imo. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Pedro, as we have such a super specific column name here... we could just update the reports using the column maybe? I am not opposed to fixing the database in this case, just wonder if want to maybe do it separately from this bug? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35679 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #17 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Katrin Fischer from comment #16)
Hi Pedro, as we have such a super specific column name here... we could just update the reports using the column maybe? I am not opposed to fixing the database in this case, just wonder if want to maybe do it separately from this bug?
Hi Katrin, thank you. I've added bug 35679. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35539 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35539 [Bug 35539] Remove unused columns from categories table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Comment on attachment 159955 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159955 Bug 26297: (QA Follow-up); Review of attachment 159955: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=26297&attachment=159955) ----------------------------------------------------------------- ::: api/v1/swagger/definitions/patron_category.yaml @@ +35,2 @@
type: - boolean
Is it really a boolean.. the comments suggest it should be an int? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #19 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 160412 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160412&action=edit Bug 26297: Update API spec lower_age_limit is a number, not a boolean -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #20 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Martin Renvoize from comment #18)
Comment on attachment 159955 [details] [review] Bug 26297: (QA Follow-up);
Review of attachment 159955 [details] [review]: -----------------------------------------------------------------
::: api/v1/swagger/definitions/patron_category.yaml @@ +35,2 @@
type: - boolean
Is it really a boolean.. the comments suggest it should be an int?
Well spotted thanks! I completely missed this. It made sense and worked when I first wrote the patch turning it into boolean on schema files, but that was wrong ( and now obsolete) so this API spec needed updating. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #21 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- 1. Why Koha/REST/V1/PatronCategories.pm and not under Koha/REST/V1/Patrons? 2. I think you should return a filtered list using Koha::Patron::Categories->search_with_library_limits instead. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35910 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #22 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 161450 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161450&action=edit Bug 26297: (QA follow-up) Move to REST::V1::Patrons::Categories -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #23 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 161451 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161451&action=edit Bug 26297: (QA follow-up) Use search_with_library_limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #24 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #21)
1. Why Koha/REST/V1/PatronCategories.pm and not under Koha/REST/V1/Patrons?
2. I think you should return a filtered list using Koha::Patron::Categories->search_with_library_limits instead.
1. An oversight, makes much more sense under Koha/REST/V1/Patrons. Patch added. 2. Patch added. It seems there are no tests in Koha for search_with_library_limits or did I miss it? Opened bug 35910 for that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #25 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Pedro Amorim from comment #24)
2. Patch added. It seems there are no tests in Koha for search_with_library_limits or did I miss it? Opened bug 35910 for that.
Scratch that, found them. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #26 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Should we really expose all those attributes to all staff with catalogue only permission? So far this is only accessible for staff with access to the admin module. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159922|0 |1 is obsolete| | Attachment #159923|0 |1 is obsolete| | Attachment #159924|0 |1 is obsolete| | Attachment #159955|0 |1 is obsolete| | Attachment #160412|0 |1 is obsolete| | Attachment #161450|0 |1 is obsolete| | Attachment #161451|0 |1 is obsolete| | --- Comment #27 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 161484 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161484&action=edit Bug 26297: Add patron categories to_api_mapping Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #28 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 161485 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161485&action=edit Bug 26297: API specs Test plan, k-t-d: 1) Access /api/v1/patron_categories 2) Verify the patron categories are correctly listed Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Bug 26297: (QA follow-up) Move to REST::V1::Patrons::Categories Bug 26297: (QA follow-up) Use search_with_library_limits JD amended-patch: squashed + tidy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #29 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 161486 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161486&action=edit Bug 26297: Add tests Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #30 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 161487 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161487&action=edit Bug 26297: Rename date_of_birth_required to lower_age_limit in api_mapping -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #31 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 161488 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161488&action=edit Bug 26297: Update API spec lower_age_limit is a number, not a boolean -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #32 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 161496 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161496&action=edit Bug 26297: (QA follow-up): Update required permission /api/v1/patrons endpoint now requires parameters:manage_patron_categories instead of just 'catalogue' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #33 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #26)
Should we really expose all those attributes to all staff with catalogue only permission?
So far this is only accessible for staff with access to the admin module.
Hi Jonathan, thanks! I've updated the required API permission to parameters:manage_patron_categories to match what's required by the original admin/categories.pl page. Are we able to put this back to SO? Thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #34 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Hi, please let me know if there's something else required here! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #35 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #26)
Should we really expose all those attributes to all staff with catalogue only permission?
So far this is only accessible for staff with access to the admin module.
Maybe we need to re-discuss the idea of having some sort of 'views' for resources, suitable for rendering dropdowns, etc. Full resource access is one thing, being about to choose one on a dropdown is another. Same as searching for patrons to display a dropdown, it doesn't require access to the full patron information. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Rest API: add a route to |Add a route to list patron |list patron categories |categories -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #36 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I've reviewed this and have a few remarks. * I felt tempted to submit all this squashed (minor/tiny thing) * The tests shouldn't delete all data, this is bad. They should probably use `q=` to constraint the resultset instead. And if we are trying to test the `search_with_library_limits` nature of the implementation, then we need to properly build the tests by adding a couple libraries, several categories limited to one and the other, and then crafting a `q=` query that searches for them all, and we only get the right ones for the branch we are logged at. * I don't like it that it returns the categories limited by branch by default. That would work for rendering dropdowns, but not for a CRUD page for categories. And that use case is vital for implementing `GET /patron_categories`. * If we need a way to restrict the returned categories by branch, then we should add a switch for that. * The standard parameters we add to all `list()` endpoints are missing on the spec (i.e. no pagination, no q=, etc). * No `use Koha::Patron::Categories;` * We should use Koha::V1::Patron::Categories, double plural sounds wrong (i.e. Patrons). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #37 from Tomás Cohen Arazi <tomascohen@gmail.com> --- * The change on the required permissions broke the tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #38 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #36)
* We should use Koha::V1::Patron::Categories, double plural sounds wrong (i.e. Patrons).
We did this all the time, nevermind :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #161484|0 |1 is obsolete| | --- Comment #39 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 165390 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165390&action=edit Bug 26297: Add patron categories to_api_mapping Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> 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=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #161485|0 |1 is obsolete| | --- Comment #40 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 165391 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165391&action=edit Bug 26297: API specs Test plan, k-t-d: 1) Access /api/v1/patron_categories 2) Verify the patron categories are correctly listed Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Bug 26297: (QA follow-up) Move to REST::V1::Patrons::Categories Bug 26297: (QA follow-up) Use search_with_library_limits JD amended-patch: squashed + tidy 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=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #161486|0 |1 is obsolete| | --- Comment #41 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 165392 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165392&action=edit Bug 26297: Add tests Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> 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=26297 --- Comment #42 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 165393 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165393&action=edit Bug 26297: (QA follow-up) Spec fixes This patch fixes some spec misses. To test: 1. Run: $ ktd --shell k$ prove xt/api.t => FAIL: Tests fail! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! 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=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #161496|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #161488|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #161487|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #43 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pedro, I think this is missing: * The tests shouldn't delete all data, this is bad. They should probably use `q=` to constraint the resultset instead. And if we are trying to test the `search_with_library_limits` nature of the implementation, then we need to properly build the tests by adding a couple libraries, several categories limited to one and the other, and then crafting a `q=` query that searches for them all, and we only get the right ones for the branch we are logged at. * I don't like it that it returns the categories limited by branch by default. That would work for rendering dropdowns, but not for a CRUD page for categories. And that use case is vital for implementing `GET /patron_categories`. * If we need a way to restrict the returned categories by branch, then we should add a switch for that. Regarding always using `search_with_library_limits`, I would be happy to stand corrected if you explain why it makes sense as-is. I added the missing parameters in a follow-up, and some minor squashed fixes, including the tests failing for permissions. The only missing bit would be redoing the tests. Happy to help if you want me to take on it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36453 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36453 [Bug 36453] BlockExpiredPatronOpacActions should allow multiple actions options -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #44 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 165453 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165453&action=edit Bug 26297: (QA follow-up): Update tests prove t/db_dependent/api/v1/patron_categories.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165453|0 |1 is obsolete| | --- Comment #45 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 165655 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165655&action=edit Bug 26297: (QA follow-up): Update tests prove t/db_dependent/api/v1/patron_categories.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #46 from Tomás Cohen Arazi <tomascohen@gmail.com> --- *** Bug 34007 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17505 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17505 [Bug 17505] Add routes for messaging preferences -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #47 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #48 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- There's a merge error here leading to an invalid spec file. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #49 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 165827 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165827&action=edit Bug 26297: (RM follow-up) Fix specification file We had a duplicate 'description' key introduced in the patron category specification file here which causes errors on bundling the specs. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #50 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Last patch attached needed on main Katrin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #51 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Follow-up will be pushed to main. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #52 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|24.05.00 |24.05.00,23.11.06 released in| | --- Comment #53 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to stable |Needs documenting --- Comment #54 from Lucas Gass <lucas@bywatersolutions.com> --- Enhancement will not be backported to 23.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED CC| |caroline.cyr-la-rose@inlibr | |o.com --- Comment #55 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- API route change, nothing to add/edit in the Koha manual. I assume API documentation is done automatically? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #56 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Tomás Cohen Arazi (tcohen) from comment #43)
Regarding always using `search_with_library_limits`, I would be happy to stand corrected if you explain why it makes sense as-is.
I added the missing parameters in a follow-up, and some minor squashed fixes, including the tests failing for permissions. The only missing bit would be redoing the tests. Happy to help if you want me to take on it.
I need a route without this restriction (ie. return all categories), how do we do? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38506 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26297 --- Comment #57 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #56)
(In reply to Tomás Cohen Arazi (tcohen) from comment #43)
Regarding always using `search_with_library_limits`, I would be happy to stand corrected if you explain why it makes sense as-is.
I added the missing parameters in a follow-up, and some minor squashed fixes, including the tests failing for permissions. The only missing bit would be redoing the tests. Happy to help if you want me to take on it.
I need a route without this restriction (ie. return all categories), how do we do?
Please file a bug with the specific use case you need to address and we discuss its implementation there. I have some ideas from earlier this year, for endpoints designed for rendering dropdowns/selectors. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org