[Koha-devel] Background jobs in plugins

Kyle Hall kyle.m.hall at gmail.com
Fri Oct 13 17:48:16 CEST 2023


I love it Tomas!

---
http://www.kylehall.info
ByWater Solutions ( http://bywatersolutions.com )
Meadville Public Library ( http://www.meadvillelibrary.org )
Crawford County Federated Library System ( http://www.ccfls.org )


On Fri, Oct 13, 2023 at 9:51 AM Tomas Cohen Arazi <tomascohen at gmail.com>
wrote:

> Look at this commit:
>
>
> https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/commit/30d1446387fa864fe49f25cb53a2915b33ef73ce
>
> Best regards
>
> El vie, 13 oct 2023 a las 10:09, Tomas Cohen Arazi (<tomascohen at gmail.com>)
> escribió:
>
>> Hi all. I'm wrapping a KitchenSink patch to highlight how it would be
>> used.
>>
>> The background jobs themselves work, but the template side I never looked
>> at. I thought there was some default display showing all the report
>> metadata, but it seems all descriptions are hardcoded and a dev is required
>> to add the ability for plugins to advertise job descriptions and have them
>> displayed as well.
>>
>> [image: image.png]
>>
>> If you want a plugin background job, it works and you should look at the
>> wiki (updated just now) and/or copy what I've done on the KitchenSink
>> plugin.
>>
>> Regarding comments on IRC, the feature was submitted during the 2022's
>> hackfest in an attempt to streamline the whole background jobs work by
>> Jonathan, and was tested, QA and pushed by others. We succeeded in moving
>> that forward, which Fridolin pushed for 22.05 and was a great improvement.
>>
>> Best regards
>>
>> El vie, 13 oct 2023 a las 3:25, David Cook (<dcook at prosentient.com.au>)
>> escribió:
>>
>>> Hi all,
>>>
>>>
>>>
>>> “Bug 30410 - Add a way for plugins to register background tasks” was
>>> pushed in Koha 22.05.00, but I can’t figure out how to make it work.
>>>
>>>
>>>
>>> Tomas, do you have a plugin where this works?
>>>
>>>
>>>
>>> I’ve gone through the patches, and it looks like I should have it right,
>>> but nothing I’m doing is working.
>>>
>>>
>>>
>>> When I enqueue the job, background_jobs.pl says “Unknown job type
>>> 'plugin_blah_blah'” even though “plugin_blah_blah” exists in
>>> Koha::BackgroundJob->new->type_class_mapping and in my plugin background
>>> job’s “job_type”.
>>>
>>>
>>>
>>> When I click “View” on the job, I get the following error: “Template
>>> process failed: file error - background_jobs/plugin_blah_blah.inc: not
>>> found at /kohadevbox/koha/C4/Templates.pm line 127”
>>>
>>>
>>>
>>> I’ll look next week at providing a simple plugin to illustrate the
>>> problem…
>>>
>>>
>>>
>>> Thanks,
>>>
>>>
>>>
>>> David Cook
>>>
>>> Senior Software Engineer
>>>
>>> Prosentient Systems
>>>
>>> Suite 7.03
>>>
>>> 6a Glen St
>>>
>>> Milsons Point NSW 2061
>>>
>>> Australia
>>>
>>>
>>>
>>> Office: 02 9212 0899
>>>
>>> Online: 02 8005 0595
>>>
>>>
>>>
>>
>>
>> --
>> Tomás Cohen Arazi
>> Theke Solutions (https://theke.io)
>> ✆ +54 9351 3513384
>> GPG: B2F3C15F
>>
>
>
> --
> Tomás Cohen Arazi
> Theke Solutions (https://theke.io)
> ✆ +54 9351 3513384
> GPG: B2F3C15F
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : https://www.koha-community.org/
> git : https://git.koha-community.org/
> bugs : https://bugs.koha-community.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20231013/172d4326/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 14694 bytes
Desc: not available
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20231013/172d4326/attachment-0001.png>


More information about the Koha-devel mailing list