On the "Check out" and "Details" pages, attempting to update a pickup library from the holds tab results in this alert: "There was an error:error Internal Server Error". This appears to be an issue with the holds rest api not functioning correctly.
This is bad. Tests for holds are raising 500 actually, so things might have been broken a while back. I'll take a look and provide a fix on monday, Kyle.
Created attachment 62564 [details] [review] Bug 18409: Make the controller for holds use Koha::Holds Recently, there's been a major fix on the REST api swagger spec, which involved fixing boolean values so they are actually booleans and Koha::Object was extended to handle that. While the swagger spec for this endpoint got fixed, such is not the case with the implementation (the controller class). This patch fixes this situation by: - Specifying boolean properties as boolean in the schema file - Fixes the controller so it returns Koha::Hold objects instead of the hashref returned by GetReserve, which is wrong. - Better (than empty) descriptions are added to 'suspend', 'suspend_until' and 'lowestPriority' on the spec. To test: - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/api/v1/holds.t => FAIL: Tests fail, mostly due to error 500 results. - Apply this patch - Run: k$ prove t/db_dependent/api/v1/holds.t => SUCCESS: Tests pass! - Sign off :-D This can also be tested using any interface for REST apis. Note: This endpoint lacks several of the new guidelines and is not complete (there's no GET for single holds, etc). It is also missing exception handling. There are probably other bug reports for that, just thought it was worth mentioning.
Created attachment 62568 [details] [review] Bug 18409: Make the controller for holds use Koha::Holds Recently, there's been a major fix on the REST api swagger spec, which involved fixing boolean values so they are actually booleans and Koha::Object was extended to handle that. While the swagger spec for this endpoint got fixed, such is not the case with the implementation (the controller class). This patch fixes this situation by: - Specifying boolean properties as boolean in the schema file - Fixes the controller so it returns Koha::Hold objects instead of the hashref returned by GetReserve, which is wrong. - Better (than empty) descriptions are added to 'suspend', 'suspend_until' and 'lowestPriority' on the spec. To test: - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/api/v1/holds.t => FAIL: Tests fail, mostly due to error 500 results. - Apply this patch - Run: k$ prove t/db_dependent/api/v1/holds.t => SUCCESS: Tests pass! - Sign off :-D This can also be tested using any interface for REST apis. Note: This endpoint lacks several of the new guidelines and is not complete (there's no GET for single holds, etc). It is also missing exception handling. There are probably other bug reports for that, just thought it was worth mentioning. Followed test plan and this patch worked as intended Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Created attachment 62601 [details] [review] Bug 18409: Make the controller for holds use Koha::Holds Recently, there's been a major fix on the REST api swagger spec, which involved fixing boolean values so they are actually booleans and Koha::Object was extended to handle that. While the swagger spec for this endpoint got fixed, such is not the case with the implementation (the controller class). This patch fixes this situation by: - Specifying boolean properties as boolean in the schema file - Fixes the controller so it returns Koha::Hold objects instead of the hashref returned by GetReserve, which is wrong. - Better (than empty) descriptions are added to 'suspend', 'suspend_until' and 'lowestPriority' on the spec. To test: - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/api/v1/holds.t => FAIL: Tests fail, mostly due to error 500 results. - Apply this patch - Run: k$ prove t/db_dependent/api/v1/holds.t => SUCCESS: Tests pass! - Sign off :-D This can also be tested using any interface for REST apis. Note: This endpoint lacks several of the new guidelines and is not complete (there's no GET for single holds, etc). It is also missing exception handling. There are probably other bug reports for that, just thought it was worth mentioning. Followed test plan and this patch worked as intended Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 17.05, thanks Tomas!
Patch doesn't apply cleanly to 16.11.x - please rebase/comment if this is needed there!
No response so far - closing.