Bug 21005: Missing row/column defaults cause unexpected results in report wizards

Some report wizards are missing row/column defaults, which sometimes return blank
pages (borrowers_stats.pl) or results always equalling 0, which a non-discerning
user may interpret incorrectly.

If the DEBUG environmental variable is enabled, missing row/column choices will
actually cause fatal software errors as well, which is also undesirable for users.

This patch adds default choices for row and column on
report wizards that had no radio buttons selected, so that a user
can't submit the form without choosing a row and column. This
prevents errors.

To test:
1) Apply patch
2) Visit /cgi-bin/koha/reports/issues_avg_stats.pl
3) Visit /cgi-bin/koha/reports/borrowers_stats.pl
4) Visit /cgi-bin/koha/reports/catalogue_stats.pl
5) Visit /cgi-bin/koha/reports/issues_stats.pl
6) Observe that default choices for row/column are there

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6a451360b8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4edef31391)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
David Cook 2018-08-10 18:08:13 +10:00 committed by Fridolin Somers
parent 1671f009e6
commit 35cbbd8de9
4 changed files with 10 additions and 10 deletions

View File

@ -77,7 +77,7 @@
<tr>
<td>Patron category</td>
<td><input type="radio" name="Line" value="categorycode" /></td>
<td><input type="radio" name="Column" value="categorycode" /></td>
<td><input type="radio" checked="checked" name="Column" value="categorycode" /></td>
<td>
<select name="Filter" size="1" id="catcode">
<option value=""></option>
@ -137,7 +137,7 @@
<tr>
<td>Library</td>
<td><input type="radio" name="Line" value="branchcode" /></td>
<td><input type="radio" checked="checked" name="Line" value="branchcode" /></td>
<td><input type="radio" name="Column" value="branchcode" /></td>
<td>
<select name="Filter" size="1" id="branch">

View File

@ -134,9 +134,9 @@
</tr>
<tr>
<td>Item type</td>
<td><input type="radio" name="Line" value="[% item_itype %]" /></td>
<td><input type="radio" name="Column" value="[% item_itype %]" /></td>
<td><select name="Filter" id="[% item_itype %]">
<td><input type="radio" name="Line" value="[% item_itype | html %]" /></td>
<td><input type="radio" checked="checked" name="Column" value="[% item_itype | html %]" /></td>
<td><select name="Filter" id="[% item_itype | html %]">
<option value=""> </option>
[% FOREACH itemtype IN itemtypes %]
<option value="[% itemtype.itemtype %]">[% itemtype.translated_description %]</option>
@ -158,7 +158,7 @@
</tr>
<tr>
<td>Home library</td>
<td><input type="radio" name="Line" value="items.homebranch" /></td>
<td><input type="radio" checked="checked" name="Line" value="items.homebranch" /></td>
<td><input type="radio" name="Column" value="items.homebranch" /></td>
<td><select name="Filter" id="branch">
<option value=""> </option>

View File

@ -110,7 +110,7 @@
<tr class="hilighted">
<td>Checkout date</td>
<td><input type="radio" name="Line" value="timestamp" /></td>
<td><input type="radio" name="Column" value="timestamp" /></td>
<td><input type="radio" checked="checked" name="Column" value="timestamp" /></td>
<td > <label for="from">From</label> <input type="text" size="10" id="from" name="Filter" />
<label for="to">To</label> <input size="10" id="to" name="Filter" value="" type="text" />
<span class="hint">[% INCLUDE 'date-format.inc' %]</span>
@ -151,7 +151,7 @@
</tr>
<tr class="hilighted">
<td>Patron category</td>
<td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
<td><input type="radio" checked="checked" name="Line" value="borrowers.categorycode" /></td>
<td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
<td>
<select name="Filter" size="1" id="borcat">

View File

@ -164,7 +164,7 @@
<tr>
<td>Item type</td>
<td><input type="radio" name="Line" value="itemtype" /></td>
<td><input type="radio" name="Column" value="itemtype" /></td>
<td><input type="radio" checked="checked" name="Column" value="itemtype" /></td>
<td><select name="Filter" id="itemtype">
<option value=""> </option>
[% FOREACH itemtype IN itemtypes %]
@ -175,7 +175,7 @@
</tr>
<tr>
<td>Issuing library</td>
<td><input type="radio" name="Line" value="branch" /></td>
<td><input type="radio" checked="checked" name="Line" value="branch" /></td>
<td><input type="radio" name="Column" value="branch" /></td>
<td><select name="Filter" id="branch">
<option value=""> </option>