Bug 10457 - Export selected items data doesn't work when using checkall checkbox
Summary: Export selected items data doesn't work when using checkall checkbox
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: David Cook
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-13 06:13 UTC by David Cook
Modified: 2014-12-07 20:02 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10457 - Export selected items data doesn't work when using checkall checkbox (2.62 KB, patch)
2013-06-13 06:54 UTC, David Cook
Details | Diff | Splinter Review
Bug 10457 - Export selected items data doesn't work when using checkall checkbox (2.70 KB, patch)
2013-06-14 11:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 10457 - Export selected items data doesn't work when using checkall checkbox (2.76 KB, patch)
2013-06-14 12:28 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2013-06-13 06:13:52 UTC
Currently, if you use the "check all" checkbox next to the "Vendor" table header, and try to "Export selected items data", you'll experience the following SQL error:

DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on
                ORDER BY title' at line 12 at /kohawebs/prod38/lib/C4/Serials.pm line 1828.

This is because the Javascript that produces the re-direct URL is including the value of the checkall checkbox, which is "on", as a "serialid". 

We need to only take checkboxes with a name of "serialid" when crafting the re-direct link.
Comment 1 David Cook 2013-06-13 06:54:40 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2013-06-14 11:33:12 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2013-06-14 12:27:53 UTC
Good catch!
The patch fixes the described issue.
Marked as Passed QA.
Comment 4 Jonathan Druart 2013-06-14 12:28:18 UTC
Created attachment 19000 [details] [review]
Bug 10457 - Export selected items data doesn't work when using checkall checkbox

Currently, if you use the "check all" checkbox next to the "Vendor"
table header, and try to "Export selected items data", you'll
experience the following SQL error:

DBD::mysql::st execute failed: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for
the right syntax to use near 'on ORDER BY title' at line 12 at
/.../lib/C4/Serials.pm line 1828.

This is because the Javascript that produces the re-direct URL is
including the value of the checkall checkbox, which is "on",
as a "serialid".

We need to only take checkboxes with a name of "serialid" when
crafting the re-direct link.

--

This patch adds the [name=serialid] attribute selector to the Jquery
that creates the URL to lateissues-excel.pl from claims.pl.

--

Test Plan:

Before applying the patch:

1) Go to Serials > Claims (found on the left navigation bar of Serials)
2) Choose a vendor that has serials to claim (or create some late
serials for a vendor so that they will show up)
3) Click on the checkbox to the left of the "Vendor" table heading.
4) Click "Export selected items data" at the bottom of the page
5) Notice that you'll get a SQL error like the one in the message
above.

Apply the patch.

Repeat Steps 1-4.

Note that you should now have a CSV file downloading rather than
getting a SQL error.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 5 Galen Charlton 2013-07-18 16:47:25 UTC
Pushed to master.  Thanks, David!
Comment 6 Bernardo Gonzalez Kriegel 2013-09-13 21:25:11 UTC
Pushed to 3.10.x, will be in 3.10.11
Already present on 3.12.4
Comment 7 Chris Hall 2013-09-15 07:55:31 UTC
Pushed to 3.8.x, will be in 3.8.18