Bugzilla – Attachment 33478 Details for
Bug 13240
advanced_notices.pl contains code obfuscation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13240: Remove some code obfuscation
Bug-13240-Remove-some-code-obfuscation.patch (text/plain), 2.27 KB, created by
Jonathan Druart
on 2014-11-12 11:29:08 UTC
(
hide
)
Description:
Bug 13240: Remove some code obfuscation
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-11-12 11:29:08 UTC
Size:
2.27 KB
patch
obsolete
>From 83b12591c5ff5786dd9216e76ebc4a2779383037 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 12 Nov 2014 12:23:38 +0100 >Subject: [PATCH] Bug 13240: Remove some code obfuscation > >my $bar; >my $foo = $bar->{borrowernumber} ||= {}; >$foo->{one} ||= 'something'; >$foo->{two}++; > >What does $bar contain? > >$VAR1 = { > 'borrowernumber' => { > 'two' => 1, > 'bar' => 'something' > } > }; > >Not really obvious. > >Maybe something I did not see is hidden. > >Test plan: >Verify the digest for DUE and PREDUE work as before. >--- > misc/cronjobs/advance_notices.pl | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > >diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl >index 62e36e4..b8d10cf 100755 >--- a/misc/cronjobs/advance_notices.pl >+++ b/misc/cronjobs/advance_notices.pl >@@ -242,9 +242,8 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > > if ( $borrower_preferences->{'wants_digest'} ) { > # cache this one to process after we've run through all of the items. >- my $digest = $due_digest->{$upcoming->{'borrowernumber'}} ||= {}; >- $digest->{email} ||= $from_address; >- $digest->{count}++; >+ $due_digest->{$upcoming->{borrowernumber}}{email} = $from_address; >+ $due_digest->{$upcoming->{borrowernumber}}{count}++; > } else { > my $biblio = C4::Biblio::GetBiblioFromItemNumber( $upcoming->{'itemnumber'} ); > my $letter_type = 'DUE'; >@@ -278,9 +277,8 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > > if ( $borrower_preferences->{'wants_digest'} ) { > # cache this one to process after we've run through all of the items. >- my $digest = $upcoming_digest->{$upcoming->{'borrowernumber'}} ||= {}; >- $digest->{email} ||= $from_address; >- $digest->{count}++; >+ $upcoming_digest->{$upcoming->{borrowernumber}}{email} = $from_address; >+ $upcoming_digest->{$upcoming->{borrowernumber}}{count}++; > } else { > my $biblio = C4::Biblio::GetBiblioFromItemNumber( $upcoming->{'itemnumber'} ); > my $letter_type = 'PREDUE'; >-- >2.1.0
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 13240
:
33478
|
33479
|
35361
|
35362
|
35704
|
35705
|
35706
|
35707