Bug 34533: jsdiff library missing from guided reports page
authorOwen Leonard <oleonard@myacpl.org>
Tue, 15 Aug 2023 08:38:20 +0000 (08:38 +0000)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Thu, 31 Aug 2023 10:11:32 +0000 (10:11 +0000)
commit021e03d8f076f7a6c336ab09d9697510e9e6b5a9
treee40798080ed65a2877675ab475a36c4bf8eb0e42
parent4b88e53ffcd3f3631833177bfc7c9eaa3916d89c
Bug 34533: jsdiff library missing from guided reports page

This patch restores the inclusion of the jsdiff JS library on the guided
reports page when displaying saved SQL reports. This fixes a JS error in
the browser console when the user tries to use our automatic update on
SQL reports which use an older syntax.

The patch also corrects a problem with svc/convert_report which was
causing an error when trying to display the diff information.

To test, apply the patch and restart services.

- Go to Reports -> Create from SQL.
- Add a report which is based on an older db structure. The example I
  found was:

  SELECT biblionumber,
  ExtractValue(marcxml,'//datafield/@tag/text()[substring(.,1,1) = "5"]') as 'notes'
  FROM biblioitems
  HAVING notes <> ''

- Save the report and go to the list of saved reports. There should be
  an "Update" column in the table, with a message about your newly-added
  report:

  "This report seems obsolete, it uses biblioitems.marcxml field."

- Clicking the "Update SQL" button should trigger a modal window that
  shows the before an after versions of the report. There should be
  no error in the browser console. Unfortunately the diff will not
  display because of a separate bug in svc/convert_report

Signed.off-by: Jessie Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f2be2cedc5e721e715a98b18299c55a0fdfa61d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 13bc2848a1104003e423cad230a741a03ebcf2da)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
svc/convert_report