Bugzilla – Attachment 188207 Details for
Bug 30618
Important and mandatory select fields not highlighted on additem.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30618: Highlight missing mandatory select2 elements in item form checks
0001-Bug-30618-Highlight-missing-mandatory-select2-elemen.patch (text/plain), 1.72 KB, created by
Emmi Takkinen
on 2025-10-21 10:10:18 UTC
(
hide
)
Description:
Bug 30618: Highlight missing mandatory select2 elements in item form checks
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2025-10-21 10:10:18 UTC
Size:
1.72 KB
patch
obsolete
>From b6466a996cddf945bac686079de057b176759b18 Mon Sep 17 00:00:00 2001 >From: lmstrand <lmstrand@gmail.com> >Date: Wed, 22 Jan 2025 13:40:14 +0200 >Subject: [PATCH] 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 >--- > koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 10 ++++++++++ > 1 file changed, 10 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >index f35750951a..f1e59ade80 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >@@ -706,6 +706,16 @@ function CheckMandatorySubfields(p) { > .find(".input_marceditor"); > } > if (!editor.val()) { >+ if ( >+ editor.hasClass("select2") || >+ editor.closest(".select2-container").length >+ ) { >+ editor >+ .siblings(".select2") >+ .children(".selection") >+ .children(".select2-selection") >+ .css("background-color", "#FFFFCC"); >+ } > editor.addClass("missing"); > total++; > } >-- >2.34.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30618
: 188207