Bug 24769 - DataTable error on patron hold page when hold placed (ILS-DI and other bugs)
Summary: DataTable error on patron hold page when hold placed (ILS-DI and other bugs)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords:
Depends on: 14711
Blocks:
  Show dependency treegraph
 
Reported: 2020-02-29 19:54 UTC by David Nind
Modified: 2020-11-30 21:49 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes a problem introduced by another patch in this release cycle. The patron's hold page now correctly lists holds where holds are placed using ILS-DI (and in some other situations).
Version(s) released in:
20.05.00
Circulation function:


Attachments
Screenshots - DataTable error on patron hold page when hold placed using ILS-DI (120.93 KB, application/pdf)
2020-02-29 19:54 UTC, David Nind
Details
Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve (1.00 KB, patch)
2020-04-24 09:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve (1.35 KB, patch)
2020-04-24 09:28 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24769: (bug 14711 follow-up 2) Fix typo in parameter name for AddReserve (1.39 KB, patch)
2020-04-24 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve (1.40 KB, patch)
2020-04-24 10:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 24769: (bug 14711 follow-up 2) Fix typo in parameter name for AddReserve (1.43 KB, patch)
2020-04-24 10:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 24769: Regression tests (2.60 KB, patch)
2020-05-04 14:45 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve (1.46 KB, patch)
2020-05-04 14:45 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 24769: (bug 14711 follow-up 2) Fix typo in parameter name for AddReserve (1.49 KB, patch)
2020-05-04 14:45 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Better tests... (2.65 KB, patch)
2020-05-04 14:54 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Nind 2020-02-29 19:54:49 UTC
Created attachment 99820 [details]
Screenshots - DataTable error on patron hold page when hold placed using ILS-DI

After placing a hold for a patron using ILS-DI an error occurs on the staff interface. 

After the hold is placed used ILS-DI, when clicking on the holds tab on a patron's details page:
- an error message pops up; and
- it no longer lists any holds.

To replicate:
1) Place a hold for a patron.
2) Check the patron's details page and holds tab, the hold is listed.
3) Enable the ILS-DI system preference.
4) Use ILS-DI to place a hold for a patron, for example:
   http://127.0.0.1:8080/cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=19&bib_id=12&request_location='27.0.0.1'
   (where: 19 = a patron id and bib_id = 12 a bibliographical record)
5) On the staff client go to Patrons > [Patron hold placed for] > Details > Holds tab.
6) An error is displayed in a pop-up window:
 DataTables warning: table id=holds-table - Ajax error. For more information about this error, please see http://datatables.net/tn/7
7) After clicking on OK for the error message, the holds tab no longer lists any holds - even though 2 should be listed.

This occurs on master, but doesn't occur on 19.11.x

It was discovered when testing bug 17229.

See the attached screenshots.
Comment 1 David Nind 2020-03-01 03:54:41 UTC
Error also showed up when testing bug 23531
Comment 2 David Nind 2020-03-03 09:38:25 UTC
Error also happening on bug 22806 before patch applied.
Comment 3 David Nind 2020-03-03 18:22:05 UTC
Error also happening on bug 11999 before patch applied.
Comment 4 David Nind 2020-04-22 09:16:25 UTC
Error also occurring after applying the patches for bug 24718 

That is not an ILS-DI related bug, so seems wider. 

Will change title to reflect this.
Comment 5 David Nind 2020-04-23 10:17:06 UTC
(In reply to David Nind from comment #4)
> Error also occurring after applying the patches for bug 24718 
> 
> That is not an ILS-DI related bug, so seems wider. 
> 
> Will change title to reflect this.

Aleisha solved resolved this with a follow-up patch to resolve the JavaScript error, but it still exists for holds placed using ILS-DI.
Comment 6 Jonathan Druart 2020-04-24 09:25:29 UTC
Caused by
  commit 11b44869d95c47a7e6daec8dcb124762a9ee0026
  Bug 14711: Change prototype for AddReserve - pass a hashref
Comment 7 Jonathan Druart 2020-04-24 09:27:05 UTC
Created attachment 103636 [details] [review]
Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve

The parameter is branchcode, not branch.

Test plan:
Place a hold on a biblio using ILSDI
Check that the branchcode is correctly filled with the patron's library
Comment 8 Jonathan Druart 2020-04-24 09:28:21 UTC
Created attachment 103637 [details] [review]
Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve

The parameter is branchcode, not branch.

Test plan:
Place a hold on a biblio using ILSDI
Check that the branchcode is correctly filled with the patron's library
Comment 9 Jonathan Druart 2020-04-24 09:32:36 UTC
Created attachment 103638 [details] [review]
Bug 24769: (bug 14711 follow-up 2) Fix typo in parameter name for AddReserve

This patch fixes 2 other occurrences. The first one is in POD of
AddReserve, the other one fixes SIP code
Comment 10 David Nind 2020-04-24 10:50:23 UTC
Created attachment 103643 [details] [review]
Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve

The parameter is branchcode, not branch.

Test plan:
Place a hold on a biblio using ILSDI
Check that the branchcode is correctly filled with the patron's library

Signed-off-by: David Nind <david@davidnind.com>
Comment 11 David Nind 2020-04-24 10:50:28 UTC
Created attachment 103644 [details] [review]
Bug 24769: (bug 14711 follow-up 2) Fix typo in parameter name for AddReserve

This patch fixes 2 other occurrences. The first one is in POD of
AddReserve, the other one fixes SIP code

Signed-off-by: David Nind <david@davidnind.com>
Comment 12 David Nind 2020-04-24 10:53:53 UTC
Thanks Jonathan for writing the patches to fix this!

This is the test plan I used:
1) Place a hold for a patron.
2) Check the patron's details page and holds tab, the hold is listed.
3) Enable the ILS-DI system preference (ILS-DI).
4) Use ILS-DI to place a hold for a patron, for example:
   http://127.0.0.1:8080/cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=19&bib_id=12&request_location='127.0.0.1'
   (where: 19 = a patron id and bib_id = 12 a bibliographical record)
5) On the staff client go to Patrons > [Patron hold placed for] > Details > Holds tab.
6) An error is displayed in a pop-up window:
 DataTables warning: table id=holds-table - Ajax error. For more information about this error, please see http://datatables.net/tn/7
7) After clicking on OK for the error message, the holds tab no longer lists any holds - even though 2 should be listed.
8) Go to the holds history for the patron and note that the Library for the hold placed using ILS-DI is blank.
9) Go to the bibliographical record and then holds - click update hold(s). Go to the patron's details page and click on the holds tab - this now displays correctly.
10) Apply the patch.
11) Repeat steps 4-5 (place a hold for another item).
12) The list of holds for the patron should display as expected with no errors.
13) Sign-off!
Comment 13 Tomás Cohen Arazi (tcohen) 2020-05-04 14:45:26 UTC
Created attachment 104296 [details] [review]
Bug 24769: Regression tests

When regressions are found, we introduce regression tests :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 14 Tomás Cohen Arazi (tcohen) 2020-05-04 14:45:33 UTC
Created attachment 104297 [details] [review]
Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve

The parameter is branchcode, not branch.

Test plan:
Place a hold on a biblio using ILSDI
Check that the branchcode is correctly filled with the patron's library

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 15 Tomás Cohen Arazi (tcohen) 2020-05-04 14:45:41 UTC
Created attachment 104298 [details] [review]
Bug 24769: (bug 14711 follow-up 2) Fix typo in parameter name for AddReserve

This patch fixes 2 other occurrences. The first one is in POD of
AddReserve, the other one fixes SIP code

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 16 Tomás Cohen Arazi (tcohen) 2020-05-04 14:54:03 UTC
Created attachment 104300 [details] [review]
Better tests...
Comment 17 Martin Renvoize (ashimema) 2020-05-05 10:04:28 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 18 Joy Nelson 2020-05-11 21:18:41 UTC
not backported to 19.11.x