Bug 22477

Summary: Missing DataTables configuration when searching patrons for holds
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: normal    
Priority: P5 - low CC: josef.moravec, katrin.fischer, martin.renvoize, nick, pierre-marc.thibault
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 22477: Missing DataTables configuration when searching patrons for holds
Bug 22477: Missing DataTables configuration when searching patrons for holds
Bug 22477: Missing DataTables configuration when searching patrons for holds
Bug 22477: Missing DataTables configuration when searching patrons for holds

Description Owen Leonard 2019-03-07 17:34:03 UTC
When placing a hold, if the page displays patron search results there is a JavaScript error in the console complaining that KohaTable is not defined. The patron search results table is supposed to be a DataTable with columns configuration but request.tt doesn't provide any column configuration.
Comment 1 Owen Leonard 2019-03-07 17:39:35 UTC
Created attachment 86328 [details] [review]
Bug 22477: Missing DataTables configuration when searching patrons for holds

This patch adds columns configuration to the holds request page to fix a
JavaScript error in the console and to allow the patron search results
table to be enabled as a DataTable.

To reproduce: Place a hold on a title in the staff client. When prompted
for a patron, perform a search which will return multiple results. The
patron search results will appear in an unsortable table. A JS error can
be seen in the browser console.

To test, apply the patch and repeat the steps above. The patron search
results table should be sortable and there should be no JS error.
Comment 2 Pierre-Marc Thibault 2019-03-08 19:07:20 UTC
Created attachment 86398 [details] [review]
Bug 22477: Missing DataTables configuration when searching patrons for holds

This patch adds columns configuration to the holds request page to fix a
JavaScript error in the console and to allow the patron search results
table to be enabled as a DataTable.

To reproduce: Place a hold on a title in the staff client. When prompted
for a patron, perform a search which will return multiple results. The
patron search results will appear in an unsortable table. A JS error can
be seen in the browser console.

To test, apply the patch and repeat the steps above. The patron search
results table should be sortable and there should be no JS error.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Comment 3 Bin Wen 2019-03-08 19:23:38 UTC
Created attachment 86399 [details] [review]
Bug 22477: Missing DataTables configuration when searching patrons for holds

This patch adds columns configuration to the holds request page to fix a
JavaScript error in the console and to allow the patron search results
table to be enabled as a DataTable.

To reproduce: Place a hold on a title in the staff client. When prompted
for a patron, perform a search which will return multiple results. The
patron search results will appear in an unsortable table. A JS error can
be seen in the browser console.

To test, apply the patch and repeat the steps above. The patron search
results table should be sortable and there should be no JS error.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Comment 4 Katrin Fischer 2019-03-09 20:38:57 UTC
Should the columns be configurable?
Comment 5 Owen Leonard 2019-03-11 12:24:04 UTC
(In reply to Katrin Fischer from comment #4)
> Should the columns be configurable?

Maybe, but I think that would be a different bug.
Comment 6 Josef Moravec 2019-03-11 16:26:24 UTC
Created attachment 86467 [details] [review]
Bug 22477: Missing DataTables configuration when searching patrons for holds

This patch adds columns configuration to the holds request page to fix a
JavaScript error in the console and to allow the patron search results
table to be enabled as a DataTable.

To reproduce: Place a hold on a title in the staff client. When prompted
for a patron, perform a search which will return multiple results. The
patron search results will appear in an unsortable table. A JS error can
be seen in the browser console.

To test, apply the patch and repeat the steps above. The patron search
results table should be sortable and there should be no JS error.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Josef Moravec 2019-03-11 16:27:28 UTC
(In reply to Owen Leonard from comment #5)
> (In reply to Katrin Fischer from comment #4)
> > Should the columns be configurable?
> 
> Maybe, but I think that would be a different bug.

I agree, this patch fixes bug, enhancement could be done on another report
Comment 8 Katrin Fischer 2019-03-11 19:24:01 UTC
I agree too - looking at the change I was just wondering, if it should be:
 columns_settings_borrowers_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
Comment 9 Nick Clemens 2019-03-15 12:49:41 UTC
Awesome work all!

Pushed to master for 19.05
Comment 10 Martin Renvoize 2019-03-19 10:40:27 UTC
Pushed to 18.11.x for 18.11.04