Bug 5569

Summary: addbiblio fails while editing and deleting mandatory repeatable subfields
Product: Koha Reporter: Janusz Kaczmarek <januszop>
Component: CatalogingAssignee: Janusz Kaczmarek <januszop>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: trivial    
Priority: PATCH-Sent (DO NOT USE) CC: chris, julian.maurice, koha.sekjal
Version: 3.4   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch

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