Bugzilla – Attachment 171288 Details for
Bug 37886
SQL reports - Multiselect parameters should be optional
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37886: Make multiselect parameters optional in SQL reports
Bug-37886-Make-multiselect-parameters-optional-in-.patch (text/plain), 3.01 KB, created by
Brendan Lawlor
on 2024-09-10 19:45:53 UTC
(
hide
)
Description:
Bug 37886: Make multiselect parameters optional in SQL reports
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-09-10 19:45:53 UTC
Size:
3.01 KB
patch
obsolete
>From 4056371a9059dba45b575c47d10ca6b46ab41a4c Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Tue, 10 Sep 2024 19:30:52 +0000 >Subject: [PATCH] Bug 37886: Make multiselect parameters optional in SQL > reports > >This bug changes the default starting value for multiselects to be a >newline separated list of all authorised values so the SQL in() function >does not limit the results when no selections are made. > >To test: >1. Create an SQL report like >select * > from items > where > homebranch in <<Libraries|branches:in>> > and > itype in <<Item type|itemtypes:in>> >2. Run the report without selecting any parameters >3. Notice no results are returned >4. Click 'Show SQL code' >5. Notice '%' is used for the parameter incorrectly >6. Apply patch and repeat step 2 >7. Notice results are returned >8. Click 'Show SQL code' >9. Notice the in() function correctly includes > a comma separated list of all authorised values >10. Run the report again with single and multiple selections >11. Confirm the SQL code is generated as expected >--- > .../prog/en/modules/reports/guided_reports_start.tt | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index ed1e0cf7de..c767083d6f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -881,7 +881,7 @@ > <label for="sql_params_[% sql_param.labelid | html %]">[% sql_param.entry | html %]:</label> > [% IF (sql_param.select_multiple) %] > <select name="[%- sql_param.input.name | html -%]" tabindex="1" id="[%- sql_param.input.id | html -%]" multiple> >- <option value="%" hidden></option> >+ <option value="[% sql_param.input.values.join("\n") | html %]" hidden selected></option> > [% ELSE %] > <select name="[%- sql_param.input.name | html -%]" tabindex="1" id="[%- sql_param.input.id | html -%]"> > [% END %] >@@ -1588,10 +1588,7 @@ > > $('#report_param_form').on('submit', function(e) { > $('#report_param_form').find('select[multiple]').each( function (i) { >- if( $(this).find('option:selected').length === 0 ) { >- $(this).val(['%']); >- } >- else if( $(this).find('option:selected').length > 1 ) { >+ if( $(this).find('option:selected').length > 1 ) { > var $selected = $('option:first', this).val(); > $(this).val($selected); > } >-- >2.39.2
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 37886
: 171288