Bug 27292

Summary: TablesSettings.GetColumns() returning nothing creates unexpected Javascript on request.tt
Product: Koha Reporter: David Cook <dcook>
Component: TemplatesAssignee: David Cook <dcook>
Status: Pushed to stable --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrew, caroline.cyr-la-rose, fridolin.somers, julian.maurice
Version: masterKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02
Bug Depends on: 24156    
Bug Blocks:    
Attachments: Bug 27292: Add TablesSettings directive to fix columns_settings_borrowers_table
Bug 27292: Add TablesSettings directive to fix columns_settings_borrowers_table
Bug 27292: Add TablesSettings directive to fix columns_settings_borrowers_table

Description David Cook 2020-12-22 06:05:28 UTC
I was rebasing Bug 15565 when I noticed strange Javascript errors.

The following code in master was the actual problem:

columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]

At the moment in koha-testing-docker, this creates the following Javascript:

"columns_settings_borrowers_table = "

For some reason, this doesn't currently cause a problem because the next line is blank and that line is followed by "$(document).ready(function() {".

Anyway, there should be data coming back there, so that's something to investigate...
Comment 1 David Cook 2020-12-23 04:44:33 UTC
Created attachment 114660 [details] [review]
Bug 27292: Add TablesSettings directive to fix columns_settings_borrowers_table

This patch adds the USE TablesSettings directive which allows the plugin
to be invoked to fill the columns_settings_borrowers_table variable.

Test plan:
0. Do not apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/reserve/request.pl?borrowernumber=51&biblionumber=29
2. View source on the page and note columns_settings_borrowers_table has no value assigned
2. Apply the patch
3. In a new tab, go to http://localhost:8081/cgi-bin/koha/reserve/request.pl?borrowernumber=51&biblionumber=29
4. Note that nothing has changed on the surfeace
5. View source ont he page and note columns_settings_borrowers_table now has a value assigned
Comment 2 David Cook 2020-12-23 04:45:02 UTC
Thanks for adding that dependency, Owen. That helped a lot. And now a patch for you (or someone else) to test :D
Comment 3 Lucas Gass 2020-12-24 20:17:39 UTC
Created attachment 114703 [details] [review]
Bug 27292: Add TablesSettings directive to fix columns_settings_borrowers_table

This patch adds the USE TablesSettings directive which allows the plugin
to be invoked to fill the columns_settings_borrowers_table variable.

Test plan:
0. Do not apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/reserve/request.pl?borrowernumber=51&biblionumber=29
2. View source on the page and note columns_settings_borrowers_table has no value assigned
2. Apply the patch
3. In a new tab, go to http://localhost:8081/cgi-bin/koha/reserve/request.pl?borrowernumber=51&biblionumber=29
4. Note that nothing has changed on the surfeace
5. View source ont he page and note columns_settings_borrowers_table now has a value assigned

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Julian Maurice 2021-01-08 08:23:24 UTC
Created attachment 114946 [details] [review]
Bug 27292: Add TablesSettings directive to fix columns_settings_borrowers_table

This patch adds the USE TablesSettings directive which allows the plugin
to be invoked to fill the columns_settings_borrowers_table variable.

Test plan:
0. Do not apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/reserve/request.pl?borrowernumber=51&biblionumber=29
2. View source on the page and note columns_settings_borrowers_table has no value assigned
2. Apply the patch
3. In a new tab, go to http://localhost:8081/cgi-bin/koha/reserve/request.pl?borrowernumber=51&biblionumber=29
4. Note that nothing has changed on the surfeace
5. View source ont he page and note columns_settings_borrowers_table now has a value assigned

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 5 Jonathan Druart 2021-01-08 14:23:25 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2021-01-11 12:25:15 UTC
Pushed to 20.11.x for 20.11.02
Comment 7 Andrew Fuerste-Henry 2021-01-15 21:52:30 UTC
Missing dependencies, not backported to 20.05