Bugzilla – Attachment 63459 Details for
Bug 17240
Allow processes that rely on background jobs run in Plack mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17240 - Allow processes that rely on background jobs run in Plack mode - followup 3
Bug-17240---Allow-processes-that-rely-on-backgroun.patch (text/plain), 3.26 KB, created by
Fridolin Somers
on 2017-05-15 06:44:55 UTC
(
hide
)
Description:
Bug 17240 - Allow processes that rely on background jobs run in Plack mode - followup 3
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2017-05-15 06:44:55 UTC
Size:
3.26 KB
patch
obsolete
>From 6f39a02deaf20be2faacb56f3a46a267b7e7b97d Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 9 May 2017 16:37:59 +0200 >Subject: [PATCH] Bug 17240 - Allow processes that rely on background jobs run > in Plack mode - followup 3 > >Followup 3 >If not running in background mode, items are not displayed in result page in tools/batchMod.pl. >Also the number of items and fields are missing in message. >--- > tools/batchMod.pl | 40 +++++++++++++++++++++++++--------------- > 1 file changed, 25 insertions(+), 15 deletions(-) > >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 0ef4248..73ef4fb 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -113,20 +113,28 @@ if ($op eq "action") { > my $marcitem; > > # Once the job is done >- if ($completedJobID) { >- # If we have a reasonable amount of items, we display them >- if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsToDisplayForBatchDel") // 1000 ) ) { >- $items_display_hashref=BuildItemsData(@itemnumbers); >- } else { >- # Else, we only display the barcode >- my @simple_items_display = map {{ itemnumber => $_, barcode => (GetBarcodeFromItemnumber($_) or ""), biblionumber => (GetBiblionumberFromItemnumber($_) or "") }} @itemnumbers; >- $template->param("simple_items_display" => \@simple_items_display); >- } >+ if ($completedJobID || !$runinbackground) { >+ # If we have a reasonable amount of items, we display them >+ if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsToDisplayForBatchDel") // 1000 ) ) { >+ $items_display_hashref=BuildItemsData(@itemnumbers); >+ } else { >+ # Else, we only display the barcode >+ my @simple_items_display = map{ >+ { >+ itemnumber => $_, >+ barcode => (GetBarcodeFromItemnumber($_) or ""), >+ biblionumber => (GetBiblionumberFromItemnumber($_) or "") >+ } >+ } @itemnumbers; >+ $template->param("simple_items_display" => \@simple_items_display); >+ } >+ } > >- # Setting the job as done >- my $job = C4::BackgroundJob->fetch($sessionID, $completedJobID); >+ if ($completedJobID) { >+ # Setting the job as done >+ my $job = C4::BackgroundJob->fetch($sessionID, $completedJobID); > >- # Calling the template >+ # Calling the template > add_saved_job_results_to_template($template, $completedJobID); > > } else { >@@ -200,9 +208,9 @@ if ($op eq "action") { > } > }; > } >+ $modified_items++ if $modified; >+ $modified_fields += $modified; > if ( $runinbackground ) { >- $modified_items++ if $modified; >- $modified_fields += $modified; > $job->set({ > modified_items => $modified_items, > modified_fields => $modified_fields, >@@ -507,7 +515,9 @@ if ($op eq "action") { > deleted_items => $deleted_items, > delete_records => $del_records, > deleted_records => $deleted_records, >- not_deleted_loop => \@not_deleted >+ not_deleted_loop => \@not_deleted, >+ modified_items => $modified_items, >+ modified_fields => $modified_fields, > ); > } > >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17240
:
55110
|
55111
|
55129
|
55130
|
55137
|
55138
|
55257
|
58461
|
63291
|
63459
|
63862
|
76477
|
76478
|
76479
|
76480
|
76481
|
76482