Bugzilla – Attachment 81872 Details for
Bug 21620
Errors when using email from stockrotation.pl cronjob
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21620: Prevent stockrotation cronjob failures
Bug-21620-Prevent-stockrotation-cronjob-failures.patch (text/plain), 3.63 KB, created by
Marcel de Rooy
on 2018-11-02 09:02:18 UTC
(
hide
)
Description:
Bug 21620: Prevent stockrotation cronjob failures
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-11-02 09:02:18 UTC
Size:
3.63 KB
patch
obsolete
>From 49a11010221e16e91799d1a0645a1218ae829a8a Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 19 Oct 2018 14:37:26 +0100 >Subject: [PATCH] Bug 21620: Prevent stockrotation cronjob failures >Content-Type: text/plain; charset=utf-8 > >Superflous use of sprintf combined with rebasing issue left the >stockrotation cronjob such that a 'No action taken' email report would >catastrophically fail with the error: > >Redundant argument in sprintf at ./stockrotation.pl line 316 > >This patch both resolves the error and cleans up some additional >unrequired sprintf usage. > >Test Plan >1) Create a rotation plan >2) Add some items to the rotation plan >3) Run the cronjob using `stockrotation.pl --report=email --send-email >--execute` >4) Note the lack of errors > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > misc/cronjobs/stockrotation.pl | 25 +++++++++++-------------- > 1 file changed, 11 insertions(+), 14 deletions(-) > >diff --git a/misc/cronjobs/stockrotation.pl b/misc/cronjobs/stockrotation.pl >index a6cd0c1..083c147 100755 >--- a/misc/cronjobs/stockrotation.pl >+++ b/misc/cronjobs/stockrotation.pl >@@ -216,9 +216,8 @@ sub report_full { > my $body = ""; > > # Summary >- $header .= sprintf " >-STOCKROTATION REPORT >---------------------\n"; >+ $header .= "STOCKROTATION REPORT\n"; >+ $header .= "--------------------\n"; > $body .= sprintf " > Total number of rotas: %5u > Inactive rotas: %5u >@@ -237,25 +236,25 @@ STOCKROTATION REPORT > $data->{advanceable}, $data->{indemand}; > > if ( @{ $data->{rotas} } ) { # Per Rota details >- $body .= sprintf "ROTAS DETAIL\n------------\n\n"; >+ $body .= "ROTAS DETAIL\n"; >+ $body .= "------------\n\n"; > foreach my $rota ( @{ $data->{rotas} } ) { > $body .= sprintf "Details for %s [%s]:\n", > $rota->{name}, $rota->{id}; >- $body .= sprintf "\n Items:"; # Rota item details >+ $body .= "\n Items:"; # Rota item details > if ( @{ $rota->{items} } ) { > $body .= > join( "", map { _print_item($_) } @{ $rota->{items} } ); > } > else { >- $body .= >- sprintf "\n No items to be processed for this rota.\n"; >+ $body .= "\n No items to be processed for this rota.\n"; > } >- $body .= sprintf "\n Log:"; # Rota log details >+ $body .= "\n Log:"; # Rota log details > if ( @{ $rota->{log} } ) { > $body .= join( "", map { _print_item($_) } @{ $rota->{log} } ); > } > else { >- $body .= sprintf "\n No items in log for this rota.\n\n"; >+ $body .= "\n No items in log for this rota.\n\n"; > } > } > } >@@ -298,9 +297,8 @@ sub report_email { > my $branched = $data->{branched}; > my $flag = 0; > >- $header .= sprintf " >-BRANCH-BASED STOCKROTATION REPORT >----------------------------------\n"; >+ $header .= "BRANCH-BASED STOCKROTATION REPORT\n"; >+ $header .= "---------------------------------\n"; > push @{$out}, $header; > > if ($branch) { # Branch limited report >@@ -314,8 +312,7 @@ BRANCH-BASED STOCKROTATION REPORT > } > else { > push @{$out}, { >- body => sprintf " >-No actionable items at any libraries.\n\n", # The body of the report >+ body => "No actionable items at any libraries.\n\n", # The body of the report > no_branch_email => 1, # We don't expect branch email in report > }; > } >-- >2.1.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 21620
:
80934
|
80935
|
81055
|
81056
|
81108
|
81110
|
81111
| 81872