Bug 5569 - addbiblio fails while editing and deleting mandatory repeatable subfields
Summary: addbiblio fails while editing and deleting mandatory repeatable subfields
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 3.4
Hardware: All All
: PATCH-Sent (DO NOT USE) trivial
Assignee: Janusz Kaczmarek
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-03 03:19 UTC by Janusz Kaczmarek
Modified: 2012-10-25 23:03 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Proposed patch (1.73 KB, patch)
2011-01-03 03:19 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Kaczmarek 2011-01-03 03:19:00 UTC
Created attachment 2936 [details] [review]
Proposed patch

If a subfield has both attributes: mandatory and repeatable a following problem occurs.  If the record is edited and there was more then one such subfield it should be still possible to delete (UnClone) or one leave empty all but one occurrence of such a subfield.  But it is not.

There are two cases: 

1) If one tries to UnClone the subfield, virtually nothing happens (because AreMandatoriesNotOk tries then to check !document.getElementById(mandatories[i]).value, whereas this object does not exist at the time, so the script fails giving no information.

2) If one deletes the text area and leaves it empty (having still another subfield correct), then the alert "Can't save this record because the following ..." appears.

Both is wrong.

Attached is proposed patch.

Regards,

Janusz
Comment 1 Chris Cormack 2011-03-12 07:49:54 UTC
Pushed, please test