Bug 30618 - Important and mandatory select fields not highlighted on additem.pl
Summary: Important and mandatory select fields not highlighted on additem.pl
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Emmi Takkinen
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-26 07:46 UTC by Emmi Takkinen
Modified: 2025-11-22 03:33 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 30618: Highlight missing mandatory select2 elements in item form checks (1.72 KB, patch)
2025-10-21 10:10 UTC, Emmi Takkinen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emmi Takkinen 2022-04-26 07:46:45 UTC
If one tries to add an item and mandatory or important select field isn't filled, field isn't highlighted like input fields.
Comment 1 Lari Strand 2023-12-01 12:21:55 UTC
As far as I can see, only the select2 elements are not highlighted after the page reloads when mandatory fields have not been filled. I couldn't locate how the "missing" properties to the elements' class are generated (like <input type="text" id="tag_952_subfield_y_371260" name="items.itype" class="input_marceditor items.itype noEnterSubmit missing" maxlength="9999" value="">), but if there was a check on whether the element is a pulldown list/any other type of element not getting highlighted, their styling could be processed separately.
Comment 2 Emmi Takkinen 2025-10-21 10:10:18 UTC
Created attachment 188207 [details] [review]
Bug 30618: Highlight missing mandatory select2 elements in item form checks

If one tries to add an item and mandatory or important select
field isn't filled, field isn't highlighted like input fields.
This patch adds correct background color to empty mandatory
select2 fields.

To test:
1. Add item, but leave mandatory select2 field empty (e.g. home
library, itemtype).
2. Attempt to save item.
=> Note that field isn't highlighted.
3. Apply this patch (restart service if needed).
4. Repeat steps 1. and 2.
=> Field should now be highlighted.

Sponsored-by: Koha-Suomi Oy
Comment 3 Jason Robb 2025-11-22 03:33:09 UTC
I tried testing this in Chrome first and there was no change, the select2 dropdowns marked as "Required" or "Important" don't highlight after trying to add an item without them.

Switching to Firefox, the highlighting works on select2 dropdowns marked as "Required", but the dropdowns marked as "Important" still don't highlight.

As a testing note, I had to go to Administration > MARC bibliographic frameworks then in the proper framework, navigate to the 952 subfields to test for "Important". Aside from home/holding library, shelving location, collection code, itemtype and the various statuses (lost, not for loan, etc.) use dropdowns.