[Bug 44257] New: Adding orders from a staged file: the "Item information" tab blocks saving when it is not used
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44257 Bug ID: 44257 Summary: Adding orders from a staged file: the "Item information" tab blocks saving when it is not used 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 adding orders from a staged file (acqui/addorderiso2709.pl), the "Item information" tab is only used for the selected records that do not bring their own items. If a record has items through MarcItemFieldsToOrder, Koha::MarcOrder creates them from the homebranch_<import_record_id> fields and ignores the tab. However, the Save button runs CheckMandatorySubfields on the whole form (koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js), including the "Item information" tab. A mandatory subfield in that tab with no default value (for example the item type in the ACQ framework) blocks saving with "Some required item subfields are not set", even when all the selected records have their own items and the tab is not used at all. The alert also tries to open the tab with $(".nav-tabs .items_info").tab("show"), but that selector no longer matches anything: the tabs are now built with the tab_item helper, which generates <a id="items_info-tab" class="nav-link" href="#items_info_panel">. The user stays on the first tab without seeing which subfield is missing. To reproduce: 1. Set AcqCreateItem to "placing an order" 2. Set MarcItemFieldsToOrder to: homebranch: 975$a holdingbranch: 975$b itype: 975$y 3. In the ACQ framework, make the item type (952$y) mandatory, with no default value 4. Stage a MARC file with a record with 975 fields ($a CPL, $b CPL, $y BK) 5. Create a basket and add to it from the staged file 6. Select the record and click Save => "Some required item subfields are not set", the order cannot be saved and the "Item information" tab is not opened -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44257 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |adolfo.rodriguez@xercode.es |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44257 --- Comment #1 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 212522 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212522&action=edit Bug 44257: Do not check the "Item information" tab when it is not used When adding orders from a staged file, the "Item information" tab is only used for the selected records that do not bring their own items through MarcItemFieldsToOrder. The save button checked the mandatory subfields of the whole form, so a mandatory subfield of that tab (for example the item type in the ACQ framework) blocked saving even when all the selected records had their own items. The alert also tried to open the tab with the selector ".nav-tabs .items_info", which no longer matches anything since the tabs are built with the tab_item helper, so the user stayed on the first tab without seeing which subfield was missing. This patch checks the mandatory subfields of the "Item information" tab only when at least one of the selected records does not have its own items, and opens the tab with the same selector used in other pages. Test plan: 1. Set AcqCreateItem to "placing an order" 2. Set MarcItemFieldsToOrder to: homebranch: 975$a holdingbranch: 975$b itype: 975$y 3. In the ACQ framework, make the item type (952$y) mandatory, with no default value 4. Stage a MARC file with two records: one with 975 fields ($a CPL, $b CPL, $y BK) and one without them 5. Create a basket and add to it from the staged file 6. Select only the record with 975 fields and click Save => The alert "Some required item subfields are not set" is shown, and the order cannot be saved, although these items do not use the "Item information" tab 7. Apply the patch and clear the browser cache 8. Repeat 6 => The order is saved, with the items from the 975 fields 9. Add to the basket from the staged file again, select the record without 975 fields and click Save without filling the "Item information" tab => The alert is shown and the "Item information" tab is opened, with the item type highlighted 10. Choose an item type and click Save => The order is saved, with an item of that type -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44257 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32045 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44257 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=44258 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org