Summary: | Jobs view breaks when there are jobs with context IS NULL | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | System Administration | Assignee: | Bugs List <koha-bugs> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | cmurdock, david, gmcharlt, jonathan.druart, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.05.00,22.11.06
|
|
Circulation function: | |||
Attachments: |
Bug 32745: Adjust context for invalid background jobs
Bug 32745: Adjust context for invalid background jobs Bug 32745: Adjust context for invalid background jobs |
Description
Katrin Fischer
2023-01-30 14:56:13 UTC
Any idea about this one? I think I saw something similar on the mailing list too. Created attachment 148643 [details] [review] Bug 32745: Adjust context for invalid background jobs We had some problems recently and it's possible to have background_jobs.context=NULL But the REST API specs is expecting an object. We could either modify the specs, or adjust the incorrect entries in DB, which is IMO better. Test plan: 0. Don't apply the patch 1. Create some background jobs 2. Set context to NULL UPDATE background_jobs SET context=NULL; 3. List the jobs and note the datatable error, and the error in Koha log OpenAPI >>> GET api/v1/jobs [{"message":"Expected object - got null.","path":"\/body\/0\/context"},{"message":"Expected object - got null.","path":"\/body\/1\/context"}] 4. Apply the patch 5. Run `updatedatabase` 6. Confirm that the list and detail view are not working correctly Created attachment 150115 [details] [review] Bug 32745: Adjust context for invalid background jobs We had some problems recently and it's possible to have background_jobs.context=NULL But the REST API specs is expecting an object. We could either modify the specs, or adjust the incorrect entries in DB, which is IMO better. Test plan: 0. Don't apply the patch 1. Create some background jobs 2. Set context to NULL UPDATE background_jobs SET context=NULL; 3. List the jobs and note the datatable error, and the error in Koha log OpenAPI >>> GET api/v1/jobs [{"message":"Expected object - got null.","path":"\/body\/0\/context"},{"message":"Expected object - got null.","path":"\/body\/1\/context"}] 4. Apply the patch 5. Run `updatedatabase` 6. Confirm that the list and detail view are not working correctly Signed-off-by: David Nind <david@davidnind.com> Testing notes (using KTD): 1. To create some background jobs, I started KTD with --es7 then updated the titles for 3 records. 2. For step 6 of the test plan, I think that should say the list and detail views ARE working correctly 8-). Created attachment 150118 [details] [review] Bug 32745: Adjust context for invalid background jobs We had some problems recently and it's possible to have background_jobs.context=NULL But the REST API specs is expecting an object. We could either modify the specs, or adjust the incorrect entries in DB, which is IMO better. Test plan: 0. Don't apply the patch 1. Create some background jobs 2. Set context to NULL UPDATE background_jobs SET context=NULL; 3. List the jobs and note the datatable error, and the error in Koha log OpenAPI >>> GET api/v1/jobs [{"message":"Expected object - got null.","path":"\/body\/0\/context"},{"message":"Expected object - got null.","path":"\/body\/1\/context"}] 4. Apply the patch 5. Run `updatedatabase` 6. Confirm that the list and detail view are not working correctly Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Are we missing a 'success' message in the database update? (is the second output line manatory?) Pushed to master for 23.05. Nice work everyone, thanks! Many hands makes light work, thankyou everyone! Pushed to 22.11.x for the next release |