Bug 23625: ArticleRequestsMandatoryFields* only affects field labels, does not make inputs required

Test plan:

1. Enable article requests ( syspref: ArticleRequests => Enable, Circ and fine rules ALL/ALL (or a given category/itemtype): Article requests => Yes )
2. Set one or more fields to require in the ArticleRequestsMandatoryFields, ArticleRequestsMandatoryFieldsItemOnly, and/or ArticleRequestsMandatoryFieldsRecordOnly settings (all these settings are affected in the same manner)
3. Search for a title and select the "Request Article" button from the OPAC search results
4. Authenticate as a patron
5. Neglect to fill out at least one of the mandatory fields
6. Select the "Place Request" button at the bottom of the form
7. The form submits despite the empty mandatory fields
8. Apply patch
9. Repeat steps 3, 5, & 6
10 . The form should refuse to submit, show a browser-native message about the missing required fields.

Sponsored-by: California College of the Arts
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Eric Phetteplace 2019-09-16 12:53:32 -07:00 committed by Martin Renvoize
parent 4b642386d8
commit 64148cf4ac
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 15 additions and 8 deletions

View File

@ -36,64 +36,71 @@
<li>
[% IF mandatory_fields.search('title') %]
<label for="title" class="required">Title:</label>
<input type="text" required name="title" id="title" size="50"/>
[% ELSE %]
<label for="title">Title:</label>
<input type="text" name="title" id="title" size="50"/>
[% END %]
<input type="text" name="title" id="title" size="50"/>
</li>
<li>
[% IF mandatory_fields.search('author') %]
<label for="author" class="required">Author:</label>
<input type="text" required name="author" id="author" size="50"/>
[% ELSE %]
<label for="author">Author:</label>
<input type="text" name="author" id="author" size="50"/>
[% END %]
<input type="text" name="author" id="author" size="50"/>
</li>
<li>
[% IF mandatory_fields.search('volume') %]
<label for="volume" class="required">Volume:</label>
<input type="text" required name="volume" id="volume" size="50"/>
[% ELSE %]
<label for="volume">Volume:</label>
<input type="text" name="volume" id="volume" size="50"/>
[% END %]
<input type="text" name="volume" id="volume" size="50"/>
</li>
<li>
[% IF mandatory_fields.search('issue') %]
<label for="issue" class="required">Issue:</label>
<input type="text" required name="issue" id="issue" size="50"/>
[% ELSE %]
<label for="issue">Issue:</label>
<input type="text" name="issue" id="issue" size="50"/>
[% END %]
<input type="text" name="issue" id="issue" size="50"/>
</li>
<li>
[% IF mandatory_fields.search('date') %]
<label for="date" class="required">Date:</label>
<input type="text" required name="date" id="date" size="50"/>
[% ELSE %]
<label for="date">Date:</label>
<input type="text" name="date" id="date" size="50"/>
[% END %]
<input type="text" name="date" id="date" size="50"/>
</li>
<li>
[% IF mandatory_fields.search('pages') %]
<label for="pages" class="required">Pages:</label>
<input type="text" required name="pages" id="pages" size="50"/>
[% ELSE %]
<label for="pages">Pages:</label>
<input type="text" name="pages" id="pages" size="50"/>
[% END %]
<input type="text" name="pages" id="pages" size="50"/>
</li>
<li>
[% IF mandatory_fields.search('chapters') %]
<label for="chapters" class="required">Chapters:</label>
<input type="text" required name="chapters" id="chapters" size="50"/>
[% ELSE %]
<label for="chapters">Chapters:</label>
<input type="text" name="chapters" id="chapters" size="50"/>
[% END %]
<input type="text" name="chapters" id="chapters" size="50"/>
</li>
<li>
@ -104,7 +111,7 @@
<li>
<label for="branchcode">Pickup library:</label>
<select name="branchcode" id="branchcode">
[% FOREACH b IN Branches.all %]
[% FOREACH b IN Branches.all %]required
[% IF b.branchcode == Branches.GetLoggedInBranchcode %]
<option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
[% ELSE %]