]> git.koha-community.org Git - koha.git/commit
Bug 10543: fix false warnings from checks of mandatory item fields
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Fri, 5 Jul 2013 13:20:59 +0000 (15:20 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 27 Aug 2013 18:12:55 +0000 (15:12 -0300)
commit9f5f05d40d2ee8a357d25472cd200a7f748de0e2
tree92864d5fc929738d44bcb4c5683550a2a0334daf
parenteec4b83d1c7ff372f7b8e1f261a45b5e6e2b9437
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.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 651ea298ea90742a2c56bbb693a4fbbb0064d5b2)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Couldn't reproduce using $i as in the test plan, but $o triggered the problem, which this patch series fix.
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt