Bug 27292 - TablesSettings.GetColumns() returning nothing creates unexpected Javascript on request.tt
Summary: TablesSettings.GetColumns() returning nothing creates unexpected Javascript o...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords: Academy
Depends on: 24156
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-22 06:05 UTC by David Cook
Modified: 2022-06-06 20:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02
Circulation function:


Attachments
Bug 27292: Add TablesSettings directive to fix columns_settings_borrowers_table (2.03 KB, patch)
2020-12-23 04:44 UTC, David Cook
Details | Diff | Splinter Review
Bug 27292: Add TablesSettings directive to fix columns_settings_borrowers_table (2.08 KB, patch)
2020-12-24 20:17 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 27292: Add TablesSettings directive to fix columns_settings_borrowers_table (2.14 KB, patch)
2021-01-08 08:23 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 (lukeg) 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