Bug 14382: Non-ISO Date parameters generate empty reports.
authorMark Tompsett <mtompset@hotmail.com>
Wed, 24 Jun 2015 16:13:46 +0000 (12:13 -0400)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Tue, 7 Jul 2015 18:17:09 +0000 (15:17 -0300)
commitc3fea53039a6c53c766b0403eedd57f644c6f772
tree2ae91731181ede1a39187ec6c8519a5a9783f54b
parent5f3ec7109321f8e928371880e473e84d8db39f8d
Bug 14382: Non-ISO Date parameters generate empty reports.

The issue is that SQL expects ISO dates, but the user may wish to view dates according to the dateformat system preference.

By detecting a date preference, the non-ISO dates can be converted to ISO dates before being stuffed back into the SQL query to be executed.

TEST PLAN
---------
1) Add a report with date parameters.
   -- I used 'Holds placed in date range' from
      http://wiki.koha-community.org/wiki/SQL_Reports_Library
2) Set your dateformat to YYYY-MM-DD
3) Run the report
   -- Note the SQL reads
      "... BETWEEN '{date formatted in YYYY-MM-DD}'..."
   -- If there is supposed to be data, there is some.
4) Set your dateformat to MM/DD/YYYY
5) Run the report
   -- Note the SQL reads
      "... BETWEEN '{date formatted in MM/DD/YYYY}'..."
   -- If there is supposed to be data, there is none.
6) Apply patch
7) Repeat steps 2-5
   -- The SQL will always read YYYY-MM-DD (ISO) format.
   -- The report will have data, if there is some.
8) koha qa test tools.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Adding a QA follow-up.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
reports/guided_reports.pl