Created attachment 67872 [details] [review] Bug 19439: Remove eval with exit statements from opac/unapi The script contains some error responses that get lost when using them in an eval statement. (Since exit should not be used within an eval construction.) The eval is removed now. Test plan: [1] Before applying this patch, you could look at the current responses from unapi for the calls in the next steps. Apply the patch now. [2] Call http(s)://[your-server]/cgi-bin/koha/unapi with only a format parameter. Check if you have a 400 status response. (In Firefox, look at Network tab of Developer Tools.) Note: Have to admit (reluctantly) that MS Edge shows the status code in the browser rightaway in contrast with Firefox. [3] Call unapi with a format=marcxml&id=999 The wrong id parameter should trigger a 404 response. [4] Call unapi with format=marcxml&id=koha:biblionumber:[notexist] where notexist is a biblionumber that not exists. This should trigger again a 404 response. [5] Call unapi with format=marcxmlx&id=koha:biblionumber:[exist] where exist should be a good biblionumber. The wrong format should trigger a 406 response. [6] Bonus: The 500 response can be tested by manipulating a XSLT file. Create invalid xml in the file for marcxml (identity.xsl in intranet xslt folder). Call unapi with format=marcxml&id=koha:biblionumber:[exist]. You should get a 500 response and have warnings in your logfile. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 67873 [details] [review] Bug 19439: (Follow-up) Remove four spaces from lines 133-149 Speaks for itself. No test plan. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 68157 [details] [review] Bug 19439: Remove eval with exit statements from opac/unapi The script contains some error responses that get lost when using them in an eval statement. (Since exit should not be used within an eval construction.) The eval is removed now. Test plan: [1] Before applying this patch, you could look at the current responses from unapi for the calls in the next steps. Apply the patch now. [2] Call http(s)://[your-server]/cgi-bin/koha/unapi with only a format parameter. Check if you have a 400 status response. (In Firefox, look at Network tab of Developer Tools.) Note: Have to admit (reluctantly) that MS Edge shows the status code in the browser rightaway in contrast with Firefox. [3] Call unapi with a format=marcxml&id=999 The wrong id parameter should trigger a 404 response. [4] Call unapi with format=marcxml&id=koha:biblionumber:[notexist] where notexist is a biblionumber that not exists. This should trigger again a 404 response. [5] Call unapi with format=marcxmlx&id=koha:biblionumber:[exist] where exist should be a good biblionumber. The wrong format should trigger a 406 response. [6] Bonus: The 500 response can be tested by manipulating a XSLT file. Create invalid xml in the file for marcxml (identity.xsl in intranet xslt folder). Call unapi with format=marcxml&id=koha:biblionumber:[exist]. You should get a 500 response and have warnings in your logfile. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 68158 [details] [review] Bug 19439: (Follow-up) Remove four spaces from lines 133-149 Speaks for itself. No test plan. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Learned something new about what Koha can do - nice!
Jonathan: Would you consider this one as a bugfix too ?
Yes, but too late for 17.11.00 now.
Created attachment 69623 [details] [review] Bug 19439: (Follow-up) Remove four spaces from lines 133-149 Speaks for itself. No test plan. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 69624 [details] [review] Bug 19439: Remove eval with exit statements from opac/unapi The script contains some error responses that get lost when using them in an eval statement. (Since exit should not be used within an eval construction.) The eval is removed now. Test plan: [1] Before applying this patch, you could look at the current responses from unapi for the calls in the next steps. Apply the patch now. [2] Call http(s)://[your-server]/cgi-bin/koha/unapi with only a format parameter. Check if you have a 400 status response. (In Firefox, look at Network tab of Developer Tools.) Note: Have to admit (reluctantly) that MS Edge shows the status code in the browser rightaway in contrast with Firefox. [3] Call unapi with a format=marcxml&id=999 The wrong id parameter should trigger a 404 response. [4] Call unapi with format=marcxml&id=koha:biblionumber:[notexist] where notexist is a biblionumber that not exists. This should trigger again a 404 response. [5] Call unapi with format=marcxmlx&id=koha:biblionumber:[exist] where exist should be a good biblionumber. The wrong format should trigger a 406 response. [6] Bonus: The 500 response can be tested by manipulating a XSLT file. Create invalid xml in the file for marcxml (identity.xsl in intranet xslt folder). Call unapi with format=marcxml&id=koha:biblionumber:[exist]. You should get a 500 response and have warnings in your logfile. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 69625 [details] [review] Bug 19439: (Follow-up) Remove four spaces from lines 133-149 Speaks for itself. No test plan. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
(In reply to Josef Moravec from comment #10) > Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Thx Josef. Welcome in the QA team !
Pushed to master for 18.05, thanks to everybody involved!
Pushed to stable for 17.11.01, awesome work all!
Depends on Bug 17797 not in 17.05.x