[Bug 27330] New: Wrong return status when no enrollments in club holds
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Bug ID: 27330 Summary: Wrong return status when no enrollments in club holds 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 It seems we are expecting a 500 if the club doesn't have any enrollments. A 403 should be returned instead. And it highlights some bad logic in the controller, as it is not catching the narrower exception, but the broader (Exceptions Koha::Club::Hold::add can throw) so some error conditions are being treated wrongly (i.e. bad parameters vs. no enrollments on the club). -- 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=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27327, 19618 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19618 [Bug 19618] Add 'Club Holds' feature https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27327 [Bug 27327] Indirect object notation in Koha::Club::Hold -- 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=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27333 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27333 [Bug 27333] Wrong exception thrown in Koha::Club::Hold::add -- 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=27330 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 114798 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114798&action=edit Bug 27330: Regression tests -- 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=27330 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 114799 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114799&action=edit Bug 27330: Return 403 if club has no enrollments This patch makes the controller script return a 403 as it should [1] instead of a plain 500. To test: 1. Apply the regressions tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D [1] https://www.restapitutorial.com/httpstatuscodes.html -- 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=27330 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 114800 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114800&action=edit Bug 27330: (follow-up) Cleanup missed on bug 23843 This patch makes some cleanup missed on bug 23843. The catch condition on the controller was copied and pasted from other controller and should be avoided unless there's a known case that needs special handling. Otherwise it will be catched by the $c->unhandled_exception call. All the old mappings were inadvertedly kept in the controller as well as the (unused) _to_api method. The base class is also cleaned from unnecessary mappings. Only mapped things need to be added. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t \ t/db_dependent/Koha/Club/Hold.t => SUCCESS: Tests pass! 3. Sign off :-D -- 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=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|27327 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27327 [Bug 27327] Indirect object notation in Koha::Club::Hold -- 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=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- 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=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agustinmoyano@theke.io, | |martin.renvoize@ptfs-europe | |.com Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- 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=27330 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This feels like it could be a `409 Conflict` response.. but I'm not really sure if it wins us much doing that rather than a `403 Forbidden`... Either way, I think the 4XX is correct, this is a client pre-condition issue.. as in patrons should have been added to a club prior to a hold being placed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Hmm, tests conflict with dependencies so this doesn't apply nicely.. I'll wait for those to get pushed before returning to this one.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- After re-reading the original tutorial I rely on for HTTP status codes [1] I think I now read it the same way you do: the user can add the patrons and THEN re-submit. So 409 makes perfect sense. My original interpretation was that some change could be made to the request for resubmitting it. I agree with 409! [1] https://www.restapitutorial.com/httpstatuscodes.html -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114800|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=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114798|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=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114799|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=27330 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 115863 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115863&action=edit Bug 27330: Use Basic auth in tests This patch puts the tests in line with the current codebase. Some bits are passed through perltidy to aid readability... To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! => SUCCESS: Tests look more like the rest of the API tests 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=27330 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 115864 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115864&action=edit Bug 27330: Regression tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 115865 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115865&action=edit Bug 27330: Return 403 if club has no enrollments This patch makes the controller script return a 403 as it should [1] instead of a plain 500. To test: 1. Apply the regressions tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D [1] https://www.restapitutorial.com/httpstatuscodes.html -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 115866 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115866&action=edit Bug 27330: (follow-up) Cleanup missed on bug 23843 This patch makes some cleanup missed on bug 23843. The catch condition on the controller was copied and pasted from other controller and should be avoided unless there's a known case that needs special handling. Otherwise it will be catched by the $c->unhandled_exception call. All the old mappings were inadvertedly kept in the controller as well as the (unused) _to_api method. The base class is also cleaned from unnecessary mappings. Only mapped things need to be added. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t \ t/db_dependent/Koha/Club/Hold.t => SUCCESS: Tests pass! 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=27330 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 115867 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115867&action=edit Bug 27330: (QA follow-up) Return 409 instead 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=27330 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Martin Renvoize from comment #5)
Hmm, tests conflict with dependencies so this doesn't apply nicely.. I'll wait for those to get pushed before returning to this one..
This was missing a dependency (bug 23857) that changed how the tests for this feature are written. As that bug will take a while, I moved the (needed) refactoring here, and added a follow-up for returning 409 instead. Thanks for the valuable feedback. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23857 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23857 [Bug 23857] Club holds endpoint not setting Location header -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115863|0 |1 is obsolete| | --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 115968 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115968&action=edit Bug 27330: Use Basic auth in tests This patch puts the tests in line with the current codebase. Some bits are passed through perltidy to aid readability... To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! => SUCCESS: Tests look more like the rest of the API tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=27330 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115864|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 115969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115969&action=edit Bug 27330: Regression tests 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=27330 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115865|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 115970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115970&action=edit Bug 27330: Return 403 if club has no enrollments This patch makes the controller script return a 403 as it should [1] instead of a plain 500. To test: 1. Apply the regressions tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D [1] https://www.restapitutorial.com/httpstatuscodes.html 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=27330 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115866|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 115971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115971&action=edit Bug 27330: (follow-up) Cleanup missed on bug 23843 This patch makes some cleanup missed on bug 23843. The catch condition on the controller was copied and pasted from other controller and should be avoided unless there's a known case that needs special handling. Otherwise it will be catched by the $c->unhandled_exception call. All the old mappings were inadvertedly kept in the controller as well as the (unused) _to_api method. The base class is also cleaned from unnecessary mappings. Only mapped things need to be added. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t \ t/db_dependent/Koha/Club/Hold.t => SUCCESS: Tests pass! 3. Sign off :-D 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=27330 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115867|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 115972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115972&action=edit Bug 27330: (QA follow-up) Return 409 instead Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=27330 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works as expected, thanks Tomas :) Signing off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=27330 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115968|0 |1 is obsolete| | --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116109 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116109&action=edit Bug 27330: Use Basic auth in tests This patch puts the tests in line with the current codebase. Some bits are passed through perltidy to aid readability... To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! => SUCCESS: Tests look more like the rest of the API tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115969|0 |1 is obsolete| | --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116110 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116110&action=edit Bug 27330: Regression tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115970|0 |1 is obsolete| | --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116111&action=edit Bug 27330: Return 403 if club has no enrollments This patch makes the controller script return a 403 as it should [1] instead of a plain 500. To test: 1. Apply the regressions tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D [1] https://www.restapitutorial.com/httpstatuscodes.html Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115971|0 |1 is obsolete| | --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116112 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116112&action=edit Bug 27330: (follow-up) Cleanup missed on bug 23843 This patch makes some cleanup missed on bug 23843. The catch condition on the controller was copied and pasted from other controller and should be avoided unless there's a known case that needs special handling. Otherwise it will be catched by the $c->unhandled_exception call. All the old mappings were inadvertedly kept in the controller as well as the (unused) _to_api method. The base class is also cleaned from unnecessary mappings. Only mapped things need to be added. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t \ t/db_dependent/Koha/Club/Hold.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115972|0 |1 is obsolete| | --- Comment #23 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116113 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116113&action=edit Bug 27330: (QA follow-up) Return 409 instead Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #24 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I've verified the tests pass and taken a look at the code, nothing obvious (to me) stood out. Trusting Martin with the functional testing here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #25 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I've verified the tests pass and taken a look at the code, nothing obvious (to me) stood out. Trusting Martin with the functional testing here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #26 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #19)
Created attachment 116109 [details] [review] Bug 27330: Use Basic auth in tests
This patch puts the tests in line with the current codebase.
Can we fix all the other tests as well please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (On its own bug report of course) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #28 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #26)
(In reply to Katrin Fischer from comment #19)
Created attachment 116109 [details] [review] [review] Bug 27330: Use Basic auth in tests
This patch puts the tests in line with the current codebase.
Can we fix all the other tests as well please?
I think it is only: - acquisitions_vendors.t - patrons_accounts.t - patrons_password.t - stockrotationstage.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #29 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- + unless ($item) { + return $c->render( + status => 404, + openapi => { error => "item_id not found." } + ); + } [...] + elsif ($biblio_id) { + $biblio = Koha::Biblios->find($biblio_id); + } + else { + return $c->render( + status => 400, + openapi => { error => "At least one of biblio_id, item_id should be given" } + ); Is that correct? (404 vs 400) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #30 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Tomás Cohen Arazi from comment #28)
(In reply to Jonathan Druart from comment #26)
(In reply to Katrin Fischer from comment #19)
Created attachment 116109 [details] [review] [review] [review] Bug 27330: Use Basic auth in tests
This patch puts the tests in line with the current codebase.
Can we fix all the other tests as well please?
I think it is only:
- acquisitions_vendors.t - patrons_accounts.t - patrons_password.t - stockrotationstage.t
"only", so you prefer to fix them here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #31 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=27587 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |27593 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27593 [Bug 27593] Inconsistent return status on club holds routes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #32 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #29)
+ unless ($item) { + return $c->render( + status => 404, + openapi => { error => "item_id not found." } + ); + }
[...]
+ elsif ($biblio_id) { + $biblio = Koha::Biblios->find($biblio_id); + } + else { + return $c->render( + status => 400, + openapi => { error => "At least one of biblio_id, item_id should be given" } + );
Is that correct? (404 vs 400)
Wrong line, but good catch :-D Fixed on bug 27593. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #33 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #30)
(In reply to Tomás Cohen Arazi from comment #28)
(In reply to Jonathan Druart from comment #26)
(In reply to Katrin Fischer from comment #19)
Created attachment 116109 [details] [review] [review] [review] [review] Bug 27330: Use Basic auth in tests
This patch puts the tests in line with the current codebase.
Can we fix all the other tests as well please?
I think it is only:
- acquisitions_vendors.t - patrons_accounts.t - patrons_password.t - stockrotationstage.t
"only", so you prefer to fix them here?
Patches for this are a bit lengthy. Handled on bug 27330. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #34 from Fridolin Somers <fridolin.somers@biblibre.com> --- Can this be backported to 20.11.x ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 --- Comment #35 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Fridolin Somers from comment #34)
Can this be backported to 20.11.x ?
Yes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|21.05.00 |21.05.00,20.11.04 released in| | --- Comment #36 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Version(s)|21.05.00,20.11.04 |21.05.00,20.11.04,20.05.10 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #37 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27330 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED CC| |victor@tuxayo.net --- Comment #38 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org