In a register with several items I select all (or some) items and click "edit selected items". I make the modification (write a public note, change the signature, change item type etc.) and click "Save", the modifications don't get saved. It used to work in previous versions.
Hi Isabel, there could be a time delay while the job is processed by the background jobs. If you go to Aministration > Background jobs, do you see any finished/unfinished jobs of type "Batch item record modification" there?
(In reply to Katrin Fischer from comment #1) > Hi Isabel, there could be a time delay while the job is processed by the > background jobs. If you go to Aministration > Background jobs, do you see > any finished/unfinished jobs of type "Batch item record modification" there? Hi Katrin. I have just tried: When I click on the link to view the details of the queued job, I get a 500 error. The intranet-error logfile gives this output: AH01215: CGI::param called in list context from /usr/share/koha/intranet/cgi-bin/catalogue/detail.pl line 622, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 415.: /usr/share/koha/intranet/cgi-bin/catalogue/detail.pl, referer: https://biblioteca-intra.ds.edu.sv/cgi-bin/koha/tools/batchMod.pl AH01215: Use of uninitialized value $mode in string ne at /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl line 886.: /usr/share/koha/intranet/cgi-bin/cataloguing/addbiblio.pl, referer: https://biblioteca-intra.ds.edu.sv/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=18080 AH01215: CGI::param called in list context from /usr/share/koha/intranet/cgi-bin/catalogue/detail.pl line 622, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 415.: /usr/share/koha/intranet/cgi-bin/catalogue/detail.pl, referer: https://biblioteca-intra.ds.edu.sv/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=18080 AH01215: Can't use an undefined value as an ARRAY reference at /usr/share/koha/lib/Koha/BackgroundJob/BatchUpdateItem.pm line 175.: /usr/share/koha/intranet/cgi-bin/admin/background_jobs.pl, referer: https://biblioteca-intra.ds.edu.sv/cgi-bin/koha/tools/batchMod.pl End of script output before headers: background_jobs.pl, referer: https://biblioteca-intra.ds.edu.sv/cgi-bin/koha/tools/batchMod.pl
Identify the id of the job in the URL and request the DB select * from background_jobs where id=X
(In reply to Jonathan Druart from comment #3) > Identify the id of the job in the URL and request the DB > > select * from background_jobs where id=X Ok. This is the content that I get in the fields: id: 357 status: new size: 2 borrowernumber: 2 type: batch_item_record_modification queue: default data: {"exclude_from_local_holds_priority":null,"regex_mod":null,"record_ids":["38409","42755"],"new_values":{"itemnotes":"test","dateaccessioned":"2022-07-25"}} The other fields are empty.
(In reply to Jonathan Druart from comment #3) > Identify the id of the job in the URL and request the DB > > select * from background_jobs where id=X Sorry, I forgot one field: id: 357 status: new size: 2 borrowernumber: 2 type: batch_item_record_modification queue: default data: {"exclude_from_local_holds_priority":null,"regex_mod":null,"record_ids":["38409","42755"],"new_values":{"itemnotes":"test","dateaccessioned":"2022-07-25"}} enqueued_on: 2022-07-25 07:14:34 The other fields are empty.
Do you see the two koha-worker processes? ps aux | grep koha-worker
(In reply to Jonathan Druart from comment #6) > Do you see the two koha-worker processes? > > ps aux | grep koha-worker I get this output: bibliot+ 21230 0.0 0.0 8468 156 ? S Jul04 0:00 daemon --name=biblioteca-koha-worker --errlog=/var/log/koha/biblioteca/worker-error.log --stdout=/var/log/koha/biblioteca/worker.log --output=/var/log/koha/biblioteca/worker-output.log --pidfiles=/var/run/koha/biblioteca/ --verbose=1 --respawn --delay=30 --user=biblioteca-koha.biblioteca-koha -- /usr/share/koha/bin/background_jobs_worker.pl --queue default biblio 4191795 0.0 0.0 9208 2216 pts/0 S+ 07:46 0:00 grep --color=auto koha-worker I have just looked into the worker-error logfile, but it is empty. The worker-output logfile gives this output: Can't call method "GetPlugins" on an undefined value at /usr/share/koha/lib/Koha/BackgroundJob.pm line 402.
Created attachment 138126 [details] [review] Bug 31223: Regression tests This patch adds tests so we are sure things don't explode with/without plugins enabled. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 138127 [details] [review] Bug 31223: Do not explode if plugins disabled This patch makes the code skip calculating the plugin-related task codes => class mapping if plugins are entirely disbaled. To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/Koha/BackgroundJob.t => FAIL: Tests explode with: Can't call method "GetPlugins" on an undefined value at... Koha/BackgroundJob.pm line 424. 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 138128 [details] [review] Bug 31223: Do not try to report results if task not started Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Need to re-do the tests.
Created attachment 138129 [details] [review] Bug 31223: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 138130 [details] [review] Bug 31223: Do not explode if plugins disabled This patch makes the code skip calculating the plugin-related task codes => class mapping if plugins are entirely disbaled. To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/Koha/Plugins/BackgroundJob.t => FAIL: Tests explode with: Can't call method "GetPlugins" on an undefined value at... Koha/BackgroundJob.pm line 424. 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 138131 [details] [review] Bug 31223: Do not try to report results if task not started Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(In reply to Isabel Pineda from comment #0) > In a register with several items I select all (or some) items and click > "edit selected items". I make the modification (write a public note, change > the signature, change item type etc.) and click "Save", the modifications > don't get saved. > It used to work in previous versions. In the meantime, you should enable plugins in koha-conf.xml until this is pushed. Also, I noticed that the task will stay as 'new' because it is not being picked by the message queue. So I suggest you: - systemctl stop rabbitmq - koha-worker --restart --queue default <instance> so it is picked again.
(In reply to Tomás Cohen Arazi from comment #15) > (In reply to Isabel Pineda from comment #0) > > In a register with several items I select all (or some) items and click > > "edit selected items". I make the modification (write a public note, change > > the signature, change item type etc.) and click "Save", the modifications > > don't get saved. > > It used to work in previous versions. > > In the meantime, you should enable plugins in koha-conf.xml until this is > pushed. > > Also, I noticed that the task will stay as 'new' because it is not being > picked by the message queue. So I suggest you: > > - systemctl stop rabbitmq > - koha-worker --restart --queue default <instance> > > so it is picked again. Thank you. The plugins were enabled, actually I am using the coverflow plugin on the OPAC. But for some reason the koha-worker wasn't working. So the line - koha-worker --restart --queue default <instance> solved the problem for me.
Created attachment 138142 [details] [review] Bug 31223: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 138143 [details] [review] Bug 31223: Do not explode if plugins disabled This patch makes the code skip calculating the plugin-related task codes => class mapping if plugins are entirely disbaled. To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/Koha/Plugins/BackgroundJob.t => FAIL: Tests explode with: Can't call method "GetPlugins" on an undefined value at... Koha/BackgroundJob.pm line 424. 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 138144 [details] [review] Bug 31223: Do not try to report results if task not started Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment on attachment 138144 [details] [review] Bug 31223: Do not try to report results if task not started Moved to bug 31245.
(In reply to Jonathan Druart from comment #20) > Comment on attachment 138144 [details] [review] [review] > Bug 31223: Do not try to report results if task not started > > Moved to bug 31245. Ok!
Created attachment 138390 [details] [review] Bug 31223: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Created attachment 138391 [details] [review] Bug 31223: Do not explode if plugins disabled This patch makes the code skip calculating the plugin-related task codes => class mapping if plugins are entirely disbaled. To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/Koha/Plugins/BackgroundJob.t => FAIL: Tests explode with: Can't call method "GetPlugins" on an undefined value at... Koha/BackgroundJob.pm line 424. 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Pushed to master for 22.11. Nice work everyone, thanks!
Lucas, please backport this one urgently.
Backported to 22.05.x for 22.05.05
won't backport to 21.11.x. depends on backgroundjobs (not available in 21.11.x).
(In reply to Arthur Suzuki from comment #27) > won't backport to 21.11.x. > depends on backgroundjobs (not available in 21.11.x). Hi Arthur, Backgroundjobs do appear to be available in Koha 21.11.x - see https://git.koha-community.org/Koha-community/Koha/src/branch/21.11.x/Koha/BackgroundJob Is this what you meant or are you referring to another set of files that are not in 21.11.x? It would be great to have this fix backported to 21.11.x! Many thanks, Alex