Bug 10543: fix false warnings from checks of mandatory item fields
Under certain circumstances, when editing an item, you get a popup
warning
"1 mandatory fields empty (highlighted)".
Even though all mandatory fields are filled in.
This occurs when there is a field with a huge content (more than 100
characters) that gets displayed in a textarea instead of input.
This patch corrects the Javascript form check by using siblings().
Also adds a more precise filter to find mandatory inputs because
looking in full page may bring unwanted results.
Test plan :
- In a framework, make sure you have in item field :
An optional subfield (without authorised value),
then a mandatory subfield, then an optional subfield
next to mandatory subfield
For example : $i (optional), $r (mandatory) and $s (optional)
- Open a biblio record and create a new item
- Enter more than 100 characters in $i, fill $r and $s
- Click "Add item"
- Edit this item
=> You get a textarea for $i
- Empty $s and Save
=> Without patch, you get a warning and form is not saved and you see that $s is yellow while it should be $r
=> With patch, form is saved
- Re-edit this item
- Empty $r and save
=> You get a warning and form is not saved
Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Notes on last patch.