Bugzilla – Attachment 162349 Details for
Bug 36027
search_for_data_inconsistencies.pl - make each section optional
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36027: Tidy code for QA script
Bug-36027-Tidy-code-for-QA-script.patch (text/plain), 2.56 KB, created by
Phan Tung Bui
on 2024-02-22 21:56:23 UTC
(
hide
)
Description:
Bug 36027: Tidy code for QA script
Filename:
MIME Type:
Creator:
Phan Tung Bui
Created:
2024-02-22 21:56:23 UTC
Size:
2.56 KB
patch
obsolete
>From 07be5809aae45ab263bf096496c3332a8c3f4c28 Mon Sep 17 00:00:00 2001 >From: Phan Tung Bui <phan-tung.bui@inlibro.com> >Date: Thu, 22 Feb 2024 16:54:24 -0500 >Subject: [PATCH] Bug 36027: Tidy code for QA script > >--- > .../search_for_data_inconsistencies.pl | 41 ++++++++++--------- > 1 file changed, 22 insertions(+), 19 deletions(-) > >diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl >index ec013efe4e..2ee1fd4cd0 100755 >--- a/misc/maintenance/search_for_data_inconsistencies.pl >+++ b/misc/maintenance/search_for_data_inconsistencies.pl >@@ -40,49 +40,52 @@ use Data::Dumper; > # Option 7: CheckRelationshipsLoop - Check for relationships or dependencies between borrowers in a loop > > my %methods = ( >-1 => \&CheckItemsBranch, >-2 => \&CheckItemsAuthHeader, >-3 => \&CheckItemsStatus, >-4 => \&CheckItemsFramework, >-5 => \&CheckItemsTitle, >-6 => \&CheckAgeForCategory, >+ 1 => \&CheckItemsBranch, >+ 2 => \&CheckItemsAuthHeader, >+ 3 => \&CheckItemsStatus, >+ 4 => \&CheckItemsFramework, >+ 5 => \&CheckItemsTitle, >+ 6 => \&CheckAgeForCategory, > ); > > my @methods_to_run; > >-if (@ARGV == 0) { >+if ( @ARGV == 0 ) { >+ > # If no arguments are provided, add all methods to the list > @methods_to_run = keys %methods; >- } else { >+} >+else { > foreach my $arg (@ARGV) { >- if ($arg =~ /^(\d+)$/) { >+ if ( $arg =~ /^(\d+)$/ ) { > my $method_number = $1; >- if ($method_number >= 1 && $method_number <= 7) { >+ if ( $method_number >= 1 && $method_number <= 7 ) { > push @methods_to_run, $method_number; >- } else { >+ } >+ else { > print "Invalid method number: $method_number\n"; > } >- } else { >+ } >+ else { > print "Invalid argument: $arg\n"; > } > } > } > > foreach my $choice (@methods_to_run) { >- if ($choice =~ /^\d+$/ && $choice >= 1 && $choice <= 7) { >- if (exists $methods{$choice}) { >+ if ( $choice =~ /^\d+$/ && $choice >= 1 && $choice <= 7 ) { >+ if ( exists $methods{$choice} ) { > $methods{$choice}->(); >- } else { >+ } >+ else { > print "Method $choice not found\n"; > } >- } else { >+ } >+ else { > print "Invalid choice: $choice\n"; > } > } > >- >- >- > sub CheckItemsBranch { > my $items = Koha::Items->search({ -or => { homebranch => undef, holdingbranch => undef }}); > if ( $items->count ) { new_section("Not defined items.homebranch and/or items.holdingbranch")} >-- >2.34.1
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 36027
:
161852
|
161953
|
161954
|
162162
|
162349
|
162351
|
162540
|
162546
|
163259
|
163956
|
166117
|
167766
|
167787
|
168953
|
168954
|
169228
|
169229
|
170847
|
170848
|
170849
|
173269
|
173270
|
173271
|
173556