https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35129
Laura Escamilla <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163343|0 |1 is obsolete| | --- Comment #7 from Laura Escamilla <[email protected]> --- Created attachment 163638 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163638&action=edit Bug 35129: Return 400 if _per_page=0 passed This patch adds a safe guard for when consumers pass _per_page=0 to endpoints. This condition is checked for on a centralized place and avoid reaching the controller in such scenarios that would provoke a division by zero exception. To test: 1. Apply the regression tests patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/pagination.t => FAIL: We expect a 400, but get a 500 instead 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! No more explosions for this! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <[email protected]> Signed-off-by: Laura Escamilla <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
