Skip to content

Commit 77c003e

Browse files
Phil Ringnaldakfischer
Phil Ringnalda
authored andcommitted
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 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
1 parent d794891 commit 77c003e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@
117117
</li>
118118
<li>
119119
<label for="displayorder">Display order: </label>
120-
<input type="text" id="displayorder" name="displayorder" value="[% displayorder | html %]" size="3" />
120+
<input type="text" inputmode="numeric" pattern="\d*" id="displayorder" name="displayorder" value="[% displayorder | html %]" size="3" />
121+
<span class="hint">Only numeric characters are allowed</span>
121122
</li>
122123
</ol>
123124
</fieldset>

serials/subscription-frequencies.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ =head1 DESCRIPTION
7575
foreach (qw/ description unit issuesperunit unitsperissue displayorder /) {
7676
$frequency->{$_} = $input->param($_);
7777
}
78-
$frequency->{unit} = undef if $frequency->{unit} eq '';
78+
$frequency->{unit} = undef if $frequency->{unit} eq '';
79+
$frequency->{displayorder} = undef if $frequency->{displayorder} eq '';
7980
foreach (qw/issuesperunit unitsperissue/) {
8081
$frequency->{$_} = 1 if $frequency->{$_} !~ /\d+/;
8182
}

0 commit comments

Comments
 (0)