Bug 29012: (QA follow-up) Use q{} instead of '' in smart-rules.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f8e77b4e8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 294ed32d06)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
Kyle Hall 2022-07-29 08:12:53 -04:00 committed by Arthur Suzuki
parent c4829c0eac
commit d43b382e99
1 changed files with 13 additions and 12 deletions

View File

@ -250,7 +250,7 @@ elsif ($op eq 'add') {
my $itemtype = $input->param('itemtype'); # item type
my $fine = $input->param('fine');
my $finedays = $input->param('finedays');
my $maxsuspensiondays = $input->param('maxsuspensiondays') || '';
my $maxsuspensiondays = $input->param('maxsuspensiondays') || q{};
my $suspension_chargeperiod = $input->param('suspension_chargeperiod') || 1;
my $firstremind = $input->param('firstremind');
my $chargeperiod = $input->param('chargeperiod');
@ -258,14 +258,14 @@ elsif ($op eq 'add') {
my $maxissueqty = strip_non_numeric( scalar $input->param('maxissueqty') );
my $maxonsiteissueqty = strip_non_numeric( scalar $input->param('maxonsiteissueqty') );
my $renewalsallowed = $input->param('renewalsallowed');
my $unseen_renewals_allowed = strip_non_numeric( scalar $input->param('unseen_renewals_allowed') ) // '';
my $unseen_renewals_allowed = strip_non_numeric( scalar $input->param('unseen_renewals_allowed') ) // q{};
my $renewalperiod = $input->param('renewalperiod');
my $norenewalbefore = $input->param('norenewalbefore');
$norenewalbefore = '' if $norenewalbefore =~ /^\s*$/;
$norenewalbefore = q{} if $norenewalbefore =~ /^\s*$/;
my $auto_renew = $input->param('auto_renew') eq 'yes' ? 1 : 0;
my $no_auto_renewal_after = $input->param('no_auto_renewal_after');
$no_auto_renewal_after = '' if $no_auto_renewal_after =~ /^\s*$/;
my $no_auto_renewal_after_hard_limit = $input->param('no_auto_renewal_after_hard_limit') || '';
$no_auto_renewal_after = q{} if $no_auto_renewal_after =~ /^\s*$/;
my $no_auto_renewal_after_hard_limit = $input->param('no_auto_renewal_after_hard_limit') || q{};
$no_auto_renewal_after_hard_limit = eval { dt_from_string( scalar $no_auto_renewal_after_hard_limit ) } if ( $no_auto_renewal_after_hard_limit );
$no_auto_renewal_after_hard_limit = output_pref( { dt => $no_auto_renewal_after_hard_limit, dateonly => 1, dateformat => 'iso' } ) if ( $no_auto_renewal_after_hard_limit );
my $reservesallowed = strip_non_numeric( scalar $input->param('reservesallowed') );
@ -275,17 +275,17 @@ elsif ($op eq 'add') {
my $issuelength = $input->param('issuelength') || 0;
my $daysmode = $input->param('daysmode');
my $lengthunit = $input->param('lengthunit');
my $hardduedate = $input->param('hardduedate') || '';
my $hardduedate = $input->param('hardduedate') || q{};
$hardduedate = eval { dt_from_string( scalar $hardduedate ) } if ( $hardduedate );
$hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
my $hardduedatecompare = $input->param('hardduedatecompare');
my $rentaldiscount = $input->param('rentaldiscount') || 0;
my $opacitemholds = $input->param('opacitemholds') || 0;
my $article_requests = $input->param('article_requests') || 'no';
my $overduefinescap = $input->param('overduefinescap') || '';
my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || '') eq 'on';
my $overduefinescap = $input->param('overduefinescap') || q{};
my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || q{}) eq 'on';
my $note = $input->param('note');
my $decreaseloanholds = $input->param('decreaseloanholds') || '';
my $decreaseloanholds = $input->param('decreaseloanholds') || q{};
my $rules = {
maxissueqty => $maxissueqty,
@ -463,7 +463,7 @@ elsif ( $op eq "add-open-article-requests-limit" ) {
Koha::Exceptions::Exception->throw("No value passed for article request limit")
if not defined $open_article_requests_limit # There is a JS check for that
|| $open_article_requests_limit eq '';
|| $open_article_requests_limit eq q{};
if ( $branch eq "*" ) {
if ( $categorycode eq "*" ) {
@ -530,6 +530,7 @@ elsif ( $op eq "add-open-article-requests-limit" ) {
);
}
}
elsif ($op eq "add-branch-item") {
my $itemtype = $input->param('itemtype');
my $holdallowed = $input->param('holdallowed');
@ -635,7 +636,7 @@ my $definedbranch = $all_rules->count ? 1 : 0;
my $rules = {};
while ( my $r = $all_rules->next ) {
$r = $r->unblessed;
$rules->{ $r->{categorycode} // '' }->{ $r->{itemtype} // '' }->{ $r->{rule_name} } = $r->{rule_value};
$rules->{ $r->{categorycode} // q{} }->{ $r->{itemtype} // q{} }->{ $r->{rule_name} } = $r->{rule_value};
}
$template->param(show_branch_cat_rule_form => 1);
@ -685,6 +686,6 @@ sub by_itemtype {
sub strip_non_numeric {
my $string = shift;
$string =~ s/\s//g;
$string = '' if $string !~ /^\d+/;
$string = q{} if $string !~ /^\d+/;
return $string;
}