Bugzilla – Attachment 174445 Details for
Bug 29818
Cannot save subscription frequency without display order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29818: Cannot save subscription frequency without display order
Bug-29818-Cannot-save-subscription-frequency-witho.patch (text/plain), 2.87 KB, created by
Phil Ringnalda
on 2024-11-13 05:51:52 UTC
(
hide
)
Description:
Bug 29818: Cannot save subscription frequency without display order
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2024-11-13 05:51:52 UTC
Size:
2.87 KB
patch
obsolete
>From f5d75a8fe38a056b00e6d9acd5d9eafb4528b2fb Mon Sep 17 00:00:00 2001 >From: Phil Ringnalda <phil@chetcolibrary.org> >Date: Tue, 12 Nov 2024 21:31:02 -0800 >Subject: [PATCH] Bug 29818: Cannot save subscription frequency without display > order > >The schema says that subscription_frequencies.displayorder can be null, and >everything else deals with it being null just fine, but if you try to save >a new frequency without specifying display order with strict_sql_modes set, >you get an error. > >Test plan: > 1. Without the patch, Serials - Manage frequencies - New frequency > 2. Description is mandatory, so fill it in, then click Save > 3. Boom! Apply patch, restart_all > 4. Repeat steps 1-2, and verify that no error is thrown and the new > frequency shows up (at the top of the list since nothing comes before > something) > 5. New frequency, fill in Description, try typing something other than a > number in Display order and saving. You should be told to follow the > directions that only numeric characters are allowed > >Sponsored-by: Chetco Community Public Library >--- > .../prog/en/modules/serials/subscription-frequencies.tt | 3 ++- > serials/subscription-frequencies.pl | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt >index ed4b28816a..2e9515f956 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt >@@ -117,7 +117,8 @@ > </li> > <li> > <label for="displayorder">Display order: </label> >- <input type="text" id="displayorder" name="displayorder" value="[% displayorder | html %]" size="3" /> >+ <input type="text" inputmode="numeric" pattern="\d*" id="displayorder" name="displayorder" value="[% displayorder | html %]" size="3" /> >+ <span class="hint">Only numeric characters are allowed</span> > </li> > </ol> > </fieldset> >diff --git a/serials/subscription-frequencies.pl b/serials/subscription-frequencies.pl >index 77fa4c268b..8378f3be81 100755 >--- a/serials/subscription-frequencies.pl >+++ b/serials/subscription-frequencies.pl >@@ -75,7 +75,8 @@ if($op && ($op eq 'cud-savenew' || $op eq 'cud-savemod')) { > foreach (qw/ description unit issuesperunit unitsperissue displayorder /) { > $frequency->{$_} = $input->param($_); > } >- $frequency->{unit} = undef if $frequency->{unit} eq ''; >+ $frequency->{unit} = undef if $frequency->{unit} eq ''; >+ $frequency->{displayorder} = undef if $frequency->{displayorder} eq ''; > foreach (qw/issuesperunit unitsperissue/) { > $frequency->{$_} = 1 if $frequency->{$_} !~ /\d+/; > } >-- >2.44.0
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 29818
:
174445
|
174577
|
174654