Bugzilla – Attachment 18629 Details for
Bug 10291
Misleading Variable names in batchMod.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated patch
0001-Bug-10291-Clarify-misleading-variable-name.patch (text/plain), 3.10 KB, created by
Colin Campbell
on 2013-06-03 14:22:03 UTC
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2013-06-03 14:22:03 UTC
Size:
3.10 KB
patch
obsolete
>From 545de4a7f575de1f5d0aa6710b0804d0bdfcf48b Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Mon, 20 May 2013 16:54:53 +0100 >Subject: [PATCH] Bug 10291: Clarify misleading variable name > >A temporary variable with the name _hashref was >being used to house an array ref >The misnomer is propagated into >the templates by passing one under a similar name. >Theres actually no need to use the variable or to >manipulate the list of itemnumbers which is used to >populate a hidden list of itemnumbers. >It was making whats already a muddled script >even harder to maintain. > >Remove the unrequired extra processing and pass >the array of itemnumbers as itemnumbers_array >--- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt | 4 ++-- > tools/batchMod.pl | 3 +-- > 3 files changed, 5 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt >index 5404f02..292b81f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt >@@ -119,8 +119,8 @@ for( x=0; x<allColumns.length; x++ ){ > > [% IF ( too_many_items ) %] > <p>Too many items ([% too_many_items %]) to display individually.</p> >- [% FOREACH itemnumbers_hashre IN itemnumbers_hashref %] >- <input type="hidden" name="itemnumber" value="[% itemnumbers_hashre.itemnumber %]" /> >+ [% FOREACH itemnumber IN itemnumbers_array %] >+ <input type="hidden" name="itemnumber" value="[% itemnumber %]" /> > [% END %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >index 01d0bc1..de67517 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >@@ -141,8 +141,8 @@ $(document).ready(function(){ > > [% IF ( too_many_items ) %] > <p>Too many items ([% too_many_items %]): not displaying each one individually.</p> >- [% FOREACH itemnumbers_hashre IN itemnumbers_hashref %] >- <input type="hidden" name="itemnumber" value="[% itemnumbers_hashre.itemnumber %]" /> >+ [% FOREACH itemnumber IN itemnumbers_array %] >+ <input type="hidden" name="itemnumber" value="[% itemnumber %]" /> > [% END %] > [% END %]<!-- /too_many_items --> > >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index c299487..ec0ef01 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -261,8 +261,7 @@ if ($op eq "show"){ > } else { > $template->param("too_many_items" => scalar(@itemnumbers)); > # Even if we do not display the items, we need the itemnumbers >- my @itemnumbers_hashref = map {{itemnumber => $_}} @itemnumbers; >- $template->param("itemnumbers_hashref" => \@itemnumbers_hashref); >+ $template->param(itemnumbers_array => \@itemnumbers); > } > # now, build the item form for entering a new item > my @loop_data =(); >-- >1.8.3.rc2 >
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 10291
:
18259
|
18629
|
18634
|
19076