Bugzilla – Attachment 141877 Details for
Bug 29012
Some rules are not saved when left blank while editing a 'rule' line in smart-rules.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Revert "Bug 29012: (QA follow-up) Use q{} instead of '' in smart-rules.pl"
Revert-Bug-29012-QA-follow-up-Use-q-instead-of--in.patch (text/plain), 5.70 KB, created by
Kevin Carnes
on 2022-10-14 12:24:33 UTC
(
hide
)
Description:
Revert "Bug 29012: (QA follow-up) Use q{} instead of '' in smart-rules.pl"
Filename:
MIME Type:
Creator:
Kevin Carnes
Created:
2022-10-14 12:24:33 UTC
Size:
5.70 KB
patch
obsolete
>From d74b7a6a2eadcb7f253b595ec16c7a755dfbcb40 Mon Sep 17 00:00:00 2001 >From: Kevin Carnes <kevin.carnes@ub.lu.se> >Date: Fri, 14 Oct 2022 14:20:58 +0200 >Subject: [PATCH] Revert "Bug 29012: (QA follow-up) Use q{} instead of '' in > smart-rules.pl" > >This reverts commit 6f8e77b4e899d6f71fb8987975ba916a65dc8229. >--- > admin/smart-rules.pl | 30 +++++++++++++++++------------- > 1 file changed, 17 insertions(+), 13 deletions(-) > >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index 3583f59884..eae23d0e1e 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -255,7 +255,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') || q{}; >+ my $maxsuspensiondays = $input->param('maxsuspensiondays') || ''; > my $suspension_chargeperiod = $input->param('suspension_chargeperiod') || 1; > my $firstremind = $input->param('firstremind'); > my $chargeperiod = $input->param('chargeperiod'); >@@ -263,14 +263,16 @@ 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') ) // q{}; >+ my $unseen_renewals_allowed = strip_non_numeric( scalar $input->param('unseen_renewals_allowed') ) // ''; > my $renewalperiod = $input->param('renewalperiod'); > my $norenewalbefore = $input->param('norenewalbefore'); >- $norenewalbefore = q{} if $norenewalbefore =~ /^\s*$/; >+ $norenewalbefore = '' 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 = 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 = '' 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_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') ); > my $holds_per_record = strip_non_numeric( scalar $input->param('holds_per_record') ); > my $holds_per_day = strip_non_numeric( scalar $input->param('holds_per_day') ); >@@ -278,15 +280,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') || q{}; >+ my $hardduedate = $input->param('hardduedate') || ''; >+ $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') || q{}; >- my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || q{}) eq 'on'; >+ my $overduefinescap = $input->param('overduefinescap') || ''; >+ my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || '') eq 'on'; > my $note = $input->param('note'); >- my $decreaseloanholds = $input->param('decreaseloanholds') || q{}; >+ my $decreaseloanholds = $input->param('decreaseloanholds') || ''; > my $recalls_allowed = $input->param('recalls_allowed'); > my $recalls_per_record = $input->param('recalls_per_record'); > my $on_shelf_recalls = $input->param('on_shelf_recalls'); >@@ -476,7 +480,7 @@ elsif ( $op eq "add-open-article-requests-limit" ) { > > Koha::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 q{}; >+ || $open_article_requests_limit eq ''; > > if ( $branch eq "*" ) { > if ( $categorycode eq "*" ) { >@@ -550,7 +554,7 @@ elsif ( $op eq "set-article-request-fee" ) { > > Koha::Exception->throw("No value passed for article request fee") > if not defined $fee # There is a JS check for that >- || $fee eq q{}; >+ || $fee eq ''; > > Koha::CirculationRules->set_rules( > { categorycode => ( $category eq '*' ) ? undef : $category, >@@ -708,7 +712,7 @@ my $definedbranch = $all_rules->count ? 1 : 0; > my $rules = {}; > while ( my $r = $all_rules->next ) { > $r = $r->unblessed; >- $rules->{ $r->{categorycode} // q{} }->{ $r->{itemtype} // q{} }->{ $r->{rule_name} } = $r->{rule_value}; >+ $rules->{ $r->{categorycode} // '' }->{ $r->{itemtype} // '' }->{ $r->{rule_name} } = $r->{rule_value}; > } > > $template->param(show_branch_cat_rule_form => 1); >@@ -758,6 +762,6 @@ sub by_itemtype { > sub strip_non_numeric { > my $string = shift; > $string =~ s/\s//g; >- $string = q{} if $string !~ /^\d+/; >+ $string = '' if $string !~ /^\d+/; > return $string; > } >-- >2.25.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 29012
:
128205
|
128206
|
131043
|
131053
|
131054
|
135194
|
135998
|
138140
|
138309
|
138310
|
141869
|
141876
|
141877
|
141878
|
141879
|
141951
|
141952
|
142248
|
142249