Bugzilla – Attachment 23913 Details for
Bug 11474
Remove experimental given/when from C4::Utils::Datatables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11474: Remove errors caused by use of switch
PASSED-QA-Bug-11474-Remove-errors-caused-by-use-of.patch (text/plain), 1.76 KB, created by
Katrin Fischer
on 2014-01-05 22:50:32 UTC
(
hide
)
Description:
[PASSED QA] Bug 11474: Remove errors caused by use of switch
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-01-05 22:50:32 UTC
Size:
1.76 KB
patch
obsolete
>From c8e6c33dc1577b186be5731d6838a857b59ade18 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Fri, 3 Jan 2014 10:47:23 +0000 >Subject: [PATCH] [PASSED QA] Bug 11474: Remove errors caused by use of switch > >Have replaced a switch statement by an if so we >do not get warnings on compilation > >Note the perldoc for the subroutine was not correct >code was not testing that paramater equalled the values >but that it contained them. Have amended accordingly >Have documented behaviour in case parameter contains >neither value. >subroutine does not appear to me used elsewhere in >codebase > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Passes all tests and QA script, especially t/DateUtils.t. >--- > C4/Utils/DataTables.pm | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/C4/Utils/DataTables.pm b/C4/Utils/DataTables.pm >index d658090..37dff72 100644 >--- a/C4/Utils/DataTables.pm >+++ b/C4/Utils/DataTables.pm >@@ -266,19 +266,19 @@ sub dt_build_query_dates { > > It calls dt_build_query_dates or dt_build_query_simple fonction of $type. > >- $type can be 'simple' or 'rage_dates'. >+ $type can contain 'simple' or 'rage_dates'. >+ if $type is not matched it returns undef > > =cut > sub dt_build_query { > my ( $type, @params ) = @_; >- given ( $type ) { >- when ( /simple/ ) { >- return dt_build_query_simple( @params ); >- } >- when ( /range_dates/ ) { >- return dt_build_query_dates( @params ); >- } >+ if ( $type =~ m/simple/ ) { >+ return dt_build_query_simple(@params); >+ } >+ elsif ( $type =~ m/range_dates/ ) { >+ return dt_build_query_dates(@params); > } >+ return; > } > > 1; >-- >1.8.3.2
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 11474
:
23899
|
23906
| 23913