Bug 40547 - Unable to view background job if enable_plugins is 0
Summary: Unable to view background job if enable_plugins is 0
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: David Cook
QA Contact: Emily Lamancusa (emlam)
URL:
Keywords: rel_24_11_candidate, rel_25_05_candidate
Depends on: 39772 40033
Blocks:
  Show dependency treegraph
 
Reported: 2025-07-30 03:19 UTC by Aleisha Amohia
Modified: 2025-08-08 13:19 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 40547: Background jobs should appear even when plugins disabled (1.67 KB, patch)
2025-07-30 06:42 UTC, David Cook
Details | Diff | Splinter Review
Bug 40547: Background jobs should appear even when plugins disabled (1.73 KB, patch)
2025-07-31 02:51 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 40547: Background jobs should appear even when plugins disabled (1.80 KB, patch)
2025-07-31 14:47 UTC, Emily Lamancusa (emlam)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2025-07-30 03:19:59 UTC
To reproduce

1. Set <enable_plugins> in koha-conf.xml to 0
2. Do a batch record modification, or some task that would set off a background job
3. Click to view the job
4. Internal server error
Comment 1 David Cook 2025-07-30 03:59:05 UTC
Oops!

This is one of the reasons I don't love method chaining.
Comment 2 David Cook 2025-07-30 06:42:40 UTC
Created attachment 184854 [details] [review]
Bug 40547: Background jobs should appear even when plugins disabled

This change fixes the background jobs so that the list page loads
even when plugins are disabled.

Test plan:
0. Apply the patch
1. Download https://github.com/HKS3/koha-normalize-marc2db/releases/download/v0.91/Koha.Plugin.HKS3.NormalizeMARC2DB-0.91.kpz
2. Upload plugin into KTD
3. Click "Run tool" for plugin
4. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
5. Note that you see a pretty "Type"
6. Go to /etc/koha/sites/kohadev/koha-conf.xml and turn enable_plugins to 0
7. sudo koha-plack --restart kohadev
8. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
9. Note it now says "Unknown job type 'plugin_marc2db_normalizeall'
10. Celebrate as this is preferable to a 500 error
Comment 3 Aleisha Amohia 2025-07-31 02:51:14 UTC
Created attachment 184918 [details] [review]
Bug 40547: Background jobs should appear even when plugins disabled

This change fixes the background jobs so that the list page loads
even when plugins are disabled.

Test plan:
0. Apply the patch
1. Download https://github.com/HKS3/koha-normalize-marc2db/releases/download/v0.91/Koha.Plugin.HKS3.NormalizeMARC2DB-0.91.kpz
2. Upload plugin into KTD
3. Click "Run tool" for plugin
4. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
5. Note that you see a pretty "Type"
6. Go to /etc/koha/sites/kohadev/koha-conf.xml and turn enable_plugins to 0
7. sudo koha-plack --restart kohadev
8. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
9. Note it now says "Unknown job type 'plugin_marc2db_normalizeall'
10. Celebrate as this is preferable to a 500 error

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 4 Emily Lamancusa (emlam) 2025-07-31 14:47:04 UTC
Created attachment 184931 [details] [review]
Bug 40547: Background jobs should appear even when plugins disabled

This change fixes the background jobs so that the list page loads
even when plugins are disabled.

Test plan:
0. Apply the patch
1. Download https://github.com/HKS3/koha-normalize-marc2db/releases/download/v0.91/Koha.Plugin.HKS3.NormalizeMARC2DB-0.91.kpz
2. Upload plugin into KTD
3. Click "Run tool" for plugin
4. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
5. Note that you see a pretty "Type"
6. Go to /etc/koha/sites/kohadev/koha-conf.xml and turn enable_plugins to 0
7. sudo koha-plack --restart kohadev
8. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
9. Note it now says "Unknown job type 'plugin_marc2db_normalizeall'
10. Celebrate as this is preferable to a 500 error

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 5 Lucas Gass (lukeg) 2025-07-31 18:48:05 UTC
Nice work everyone!

Pushed to main for 25.11