https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41921

--- Comment #164 from Brendan Lawlor <[email protected]> ---
Created attachment 208039
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208039&action=edit
Bug 41921: (QA follow-up) Fix report jobs list for deleted reports

In Koha::REST::V1::Reports::Jobs::list
calling can_access on an undefined report dies,
GET /api/v1/reports/jobs returns 500,
and the Report jobs dashboard blows up.

This patch only checks can_access when the report still exists.
Jobs for deleted reports stay in the list, where the dashboard
shows them as "(report deleted)".

Test plan:
1. Set ReportsRunInBackground to "let the user choose"
2. Go to Reports > Saved reports, run a report and choose
   "Queue as background job"
3. Wait for the job to finish on the Report jobs page
4. Delete that saved report
5. Go to Reports > Report jobs
6. Note the "Background jobs" table fails to load, and
   /api/v1/reports/jobs returns 500, an alert pops up
7. Apply patch and restart_all
8. Reload Reports > Report jobs
9. Note the table loads and the job shows "(report deleted)"
10. Run:
    prove t/db_dependent/api/v1/reports_jobs.t

Sponsored-by: CLAMS
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Brendan Lawlor <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to