https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44328 Bug ID: 44328 Summary: Clear in the acquisitions item form can create items without a library Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: adolfo.rodriguez@xercode.es QA Contact: testopia@bugs.koha-community.org Target Milestone: --- When items are created on ordering or on receiving (AcqCreateItem), the "Clear" button of the item block (clearItemBlock in additem.js) resets every select to its first option and empties every text input, including the subfields hidden in the ACQ framework. If 952$a or 952$b is not mandatory, its first option is the empty one, so the item is created without a home or current library (items.homebranch or items.holdingbranch NULL). When the subfield is hidden the user cannot even see it. The record's detail page then fails to load its items table: GET /api/v1/biblios/<id>/items: unhandled exception (Mojo::Exception) <<DBIC result _type isn't of the _type Branch at Koha/Objects.pm line 452.>> If the subfield is mandatory, "Clear" picks the first library in alphabetical order instead of the logged in library, without the user noticing when it is hidden. To reproduce: 1. AcqCreateItem = "Placing an order". 2. ACQ framework, 952$a: untick all the Visibility checkboxes and Mandatory. 3. Add an order from a new (empty) record, click "Clear" in the item block, choose an item type, add the item and save the order. 4. The item has no home library and the detail page of the record cannot load its items. Also, attr("selected", true) only changes the attribute, so a select already changed by the user is not reset by "Clear". -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.