Bug 36907: Add maxlength to OAI set mapping form fields

This patch adds a maxlength attribute to the field, subfield, and value
fields in the OAI set mapping form. This helps prevent an error when the
form data is too long for the database columns.

Unrelated: The patch also adds quotes around two unquoted name
attributes.

To test, apply the patch and go to Administration -> OAI sets.

- If necessary, create a new set.
- Click Actions -> Define mappings.
- Test that each form field is limited correctly:
  Field: 3
  Subfield: 1
  Value: 80
- Test that the form can be submitted successfully with the maximum
  number of characters in each field.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c3f47091de)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2024-05-21 15:09:59 +00:00 committed by Lucas Gass
parent e7a6fe1036
commit 4f9707dcd1
1 changed files with 5 additions and 5 deletions

View File

@ -81,9 +81,9 @@
[% END %]
</select>
</td>
<td><input type="text" name="marcfield" size="3" value="[% mapping.marcfield | html %]" /></td>
<td><input type="text" name="marcsubfield" size="1" value="[% mapping.marcsubfield | html %]" /></td>
<td><select name=operator>
<td><input type="text" name="marcfield" size="3" maxlength="3" value="[% mapping.marcfield | html %]" /></td>
<td><input type="text" name="marcsubfield" size="1" maxlength="1" value="[% mapping.marcsubfield | html %]" /></td>
<td><select name="operator">
[% IF mapping.operator == 'equal' %]
<option value="equal" selected="selected">is equal to</option>
<option value="notequal">not equal to</option>
@ -92,7 +92,7 @@
<option value="notequal" selected="selected">not equal to</option>
[% END %]
</select></td>
<td><input type="text" name="marcvalue" value="[% mapping.marcvalue | html %]" /></td>
<td><input type="text" name="marcvalue" maxlength="80" value="[% mapping.marcvalue | html %]" /></td>
<td>
[% IF ( loop.last ) %]
<button type="button" id="new_rule_button" class="btn btn-default btn-xs" title="Add another condition"><i class="fa fa-plus"></i> Add</button>
@ -119,7 +119,7 @@
</td>
<td><input type="text" name="marcfield" size="3" /></td>
<td><input type="text" name="marcsubfield" size="1" /></td>
<td><select name=operator>
<td><select name="operator">
<option value="equal">is equal to</option>
<option value="notequal">not equal to</option>
</select></td>