[Bug 37077] New: SQL Reports - Picking only one option for each multiple selection results in wrong query
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Bug ID: 37077 Summary: SQL Reports - Picking only one option for each multiple selection results in wrong query Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Reports Assignee: koha-bugs@lists.koha-community.org Reporter: pedro.amorim@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: andrewfh@dubcolib.org, blawlor@clamsnet.org, caroline.cyr-la-rose@inlibro.com Depends on: 35746 To reproduce: 1. Go to Reports and create a report from SQL select * from items where homebranch in <<Libraries|branches:in>> and itype in <<Item type|itemtypes:in>> 3. Run the report but pick only 1 library and 1 item type 4. Click the "Show SQL code" 5. Notice itype value is wrong. It's using the same value selected for library. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35746 [Bug 35746] Multiple selections for parameters used in the IN function -- 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=37077 --- Comment #1 from Brendan Lawlor <blawlor@clamsnet.org> --- This one is my bad. Thanks Pedro! It's happening because the url query string is getting sent duplicate values when only one value is selected. Then on the perl side the duplicate param for the first select gets inserted into the query where the second param should be. The example query you wrote generates a url like this: http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?id=1¶m_name=Libraries%7Cbranches%3Ain&sql_params=CPL&sql_params=CPL¶m_name=Item+type%7Citemtypes%3Ain&sql_params=BK&sql_params=BK&op=run when it should be like this: http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?id=1¶m_name=Libraries%7Cbranches%3Ain&sql_params=CPL¶m_name=Item+type%7Citemtypes%3Ain&sql_params=BK&op=run This should be fixable in the javascript that overrides the form submission. -- 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=37077 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=37077 --- Comment #2 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 167762 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167762&action=edit Bug 37077: Fix report muti select for zero and single selections This patch updates the javascript overriding the form submission when reports have multi select parameters. When there are more than one multi selects, and the user selcts one value from each, it skips updating the value of the select, so it doens't send duplicate parameters anymore. If there are no selections made it will pass '%' for all values. This allows the multi select to be optional in the report. If no selections are made it is assumed that you are not using that parameter to limit the report. -- 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=37077 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167762|0 |1 is obsolete| | --- Comment #3 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 167763 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167763&action=edit Bug 37077: Fix report muti select for zero and single selections This patch updates the javascript overriding the form submission when reports have multi select parameters. When there are more than one multi selects, and the user selcts one value from each, it skips updating the value of the select, so it doens't send duplicate parameters anymore. If there are no selections made it will pass '%' for all values. This allows the multi select to be optional in the report. If no selections are made it is assumed that you are not using that parameter to limit the report. Test plan: 1. Go to Reports and create a report from SQL select * from items where homebranch in <<Libraries|branches:in>> and itype in <<Item type|itemtypes:in>> 3. Run the report but pick only 1 library and 1 item type 4. Click the "Show SQL code" 5. Notice that the two parameters were filled correctly 6. Run the report again with zero selections 7. Click the "Show SQL code" 8. Notice that the '%' is used for the parameter 9. Run the report again with combinations of single, multiple and zero selections 10. confirm the SQL code is generated as you would expect. -- 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=37077 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167763|0 |1 is obsolete| | --- Comment #4 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 167765 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167765&action=edit Bug 37077: Fix report muti select for zero and single selections This patch updates the javascript overriding the form submission when reports have multi select parameters. When there are more than one multi selects, and the user selcts one value from each, it skips updating the value of the select, so it doens't send duplicate parameters anymore. If there are no selections made it will pass '%' for all values. This allows the multi select to be optional in the report. If no selections are made it is assumed that you are not using that parameter to limit the report. Test plan: 1. Go to Reports and create a report from SQL select * from items where homebranch in <<Libraries|branches:in>> and itype in <<Item type|itemtypes:in>> 3. Run the report but pick only 1 library and 1 item type 4. Click the "Show SQL code" 5. Notice that the two parameters were filled correctly 6. Run the report again with zero selections 7. Click the "Show SQL code" 8. Notice that the '%' is used for the parameter 9. Run the report again with combinations of single, multiple and zero selections 10. confirm the SQL code is generated as you would expect. -- 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=37077 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |blawlor@clamsnet.org |ity.org | Patch complexity|--- |Small patch -- 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=37077 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167765|0 |1 is obsolete| | --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 167785 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167785&action=edit Bug 37077: Fix report muti select for zero and single selections This patch updates the javascript overriding the form submission when reports have multi select parameters. When there are more than one multi selects, and the user selcts one value from each, it skips updating the value of the select, so it doens't send duplicate parameters anymore. If there are no selections made it will pass '%' for all values. This allows the multi select to be optional in the report. If no selections are made it is assumed that you are not using that parameter to limit the report. Test plan: 1. Go to Reports and create a report from SQL select * from items where homebranch in <<Libraries|branches:in>> and itype in <<Item type|itemtypes:in>> 3. Run the report but pick only 1 library and 1 item type 4. Click the "Show SQL code" 5. Notice that the two parameters were filled correctly 6. Run the report again with zero selections 7. Click the "Show SQL code" 8. Notice that the '%' is used for the parameter 9. Run the report again with combinations of single, multiple and zero selections 10. confirm the SQL code is generated as you would expect. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Katie Bliss <kebliss@dmpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kebliss@dmpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |Main Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167785|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 169987 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169987&action=edit Bug 37077: Fix report muti select for zero and single selections This patch updates the javascript overriding the form submission when reports have multi select parameters. When there are more than one multi selects, and the user selcts one value from each, it skips updating the value of the select, so it doens't send duplicate parameters anymore. If there are no selections made it will pass '%' for all values. This allows the multi select to be optional in the report. If no selections are made it is assumed that you are not using that parameter to limit the report. Test plan: 1. Go to Reports and create a report from SQL select * from items where homebranch in <<Libraries|branches:in>> and itype in <<Item type|itemtypes:in>> 3. Run the report but pick only 1 library and 1 item type 4. Click the "Show SQL code" 5. Notice that the two parameters were filled correctly 6. Run the report again with zero selections 7. Click the "Show SQL code" 8. Notice that the '%' is used for the parameter 9. Run the report again with combinations of single, multiple and zero selections 10. confirm the SQL code is generated as you would expect. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: It works but feels like hacking. Can understand that this is easier than rewriting the whole module ;) Hard to maintain.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Marcel de Rooy from comment #7)
QA Comment: It works but feels like hacking. Can understand that this is easier than rewriting the whole module ;) Hard to maintain..
Makes me feel like maybe we should have a follow-up bug at least outlining how we could do better? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Fixed typo in commit message. (muti) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37886 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37886 [Bug 37886] SQL reports - Multiselect parameters should be optional -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.11.00 |24.11.00,24.05.04 released in| | Status|Pushed to main |Pushed to stable CC| |lucas@bywatersolutions.com --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 35746 not in 23.11.x I do not change status because of "additional_work_needed" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #13 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37077 Bug 37077 depends on bug 35746, which changed state. Bug 35746 Summary: Multiple selections for parameters used in the IN function https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35746 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org