Bug 40819: Only initialize select2 for #report_param_form

This patch makes the the css selector specifically target the
report_param_form in guided reports

To test:
1. Go to Reports > Create guided report
2. Click Next >>
3. Click Next >>
3. Notice the form has been initialized as select2
4. Apply patch and refresh the page
5. Confirm the select column form is back to normal
6. Confirm select2 is still initialized for SQL reports
   example: select * from items where homebranch IN <<Library|branches:in>>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 646109833f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Brendan Lawlor 2025-09-16 17:47:20 +00:00 committed by Paul Derscheid
parent 368fa69831
commit ae67fcfe40
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 1 additions and 1 deletions

View File

@ -2451,7 +2451,7 @@
}); });
// Apply select2 to all select fields having a "multiple" attribute // Apply select2 to all select fields having a "multiple" attribute
let selectFields = document.querySelectorAll('select[multiple]'); let selectFields = document.querySelectorAll('#report_param_form select[multiple]');
selectFields.forEach((selectField) => { selectFields.forEach((selectField) => {
selectField.style.minWidth = '320px'; selectField.style.minWidth = '320px';
$(selectField).select2(); $(selectField).select2();