Bugzilla – Attachment 125264 Details for
Bug 29073
Hold expiration added to new holds when DefaultHoldExpirationdate turned off
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate
Bug-29073-Use-0-and-1-as-values-for-DefaultHoldExp.patch (text/plain), 2.62 KB, created by
Martin Renvoize (ashimema)
on 2021-09-24 15:16:28 UTC
(
hide
)
Description:
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-24 15:16:28 UTC
Size:
2.62 KB
patch
obsolete
>From 2783043f987fab383f5827a149e6aa21b3cc745c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 21 Sep 2021 15:15:15 +0000 >Subject: [PATCH] Bug 29073: Use 0 and 1 as values for > DefaultHoldExpirationdate > >DefaultHldexpirationDate is set in the pref screen to 'yes/no' > >The code checks if the preference is 'true', 'no' is true > >We should instead use 1/0 > >To test: >0 - Have a fresh devbox >1 - With syspref disabled, place a hold >2 - Note no expiration date set >3 - Enable the preference >4 - Place a hold and note the expiration date is set, good >5 - Disable the pref >6 - Place a hold and note the expiration date is set, bad >7 - Apply patch >8 - Update database >9 - Repeat 1-8, date not set when pref disabled > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > installer/data/mysql/atomicupdate/bug_29073.pl | 17 +++++++++++++++++ > .../modules/admin/preferences/circulation.pref | 4 ++-- > 2 files changed, 19 insertions(+), 2 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_29073.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_29073.pl b/installer/data/mysql/atomicupdate/bug_29073.pl >new file mode 100755 >index 00000000000..ef06a3e8f05 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_29073.pl >@@ -0,0 +1,17 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "29073", >+ description => "Make DefaultHoldExpirationdate use 1/0 values", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ # Do you stuffs here >+ $dbh->do(q{ >+ UPDATE systempreferences SET value = IF(value = 'yes',1,0) >+ WHERE variable = 'DefaultHoldExpirationdate'; >+ }); >+ # Print useful stuff here >+ say $out "DefaultHoldExpirationdate values updated"; >+ }, >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index fc07ec1ed65..8a3cfc4dc75 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -901,8 +901,8 @@ Circulation: > - pref: DefaultHoldExpirationdate > default: 0 > choices: >- yes: Set >- no: Don't set >+ 1: Set >+ 0: Don't set > - default expiration date for holds automatically. > - If enabled, set expiration date > - pref: DefaultHoldExpirationdatePeriod >-- >2.20.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 29073
:
125111
|
125113
| 125264