Bug 26361 - JS error on returns.tt in 20.05
Summary: JS error on returns.tt in 20.05
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 20.05
Hardware: All All
: P3 normal
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
: 26399 (view as bug list)
Depends on: 25940
Blocks:
  Show dependency treegraph
 
Reported: 2020-09-02 22:55 UTC by Lucas Gass (lukeg)
Modified: 2021-12-13 21:08 UTC (History)
10 users (show)

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


Attachments
Bug 26361: switch TableSettings to ColumnSettings (1.31 KB, patch)
2020-09-03 03:59 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 26361: switch TableSettings to ColumnSettings (1.37 KB, patch)
2020-09-03 07:47 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26361: switch TableSettings to ColumnSettings (1.44 KB, patch)
2020-09-03 08:38 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2020-09-02 22:55:43 UTC
To recreate:

-Be on 20.05.x
-Go to returns.tt
-See the error Uncaught SyntaxError: expected expression, got keyword 'var'.
-Check the page source and you will see that:

var columns_settings = [% TablesSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) | $raw %]

is being evaluated to:

var columns_settings =
Comment 1 Lucas Gass (lukeg) 2020-09-02 23:17:52 UTC
Unfortunately I think 20.05.03 was packaged with this error
Comment 2 Lucas Gass (lukeg) 2020-09-03 03:55:17 UTC
This is the result of a bad rebase of 25940. I rebased with TablesSettings instead if ColumnSettings. TableSettings is not in 20.05 or below
Comment 3 Lucas Gass (lukeg) 2020-09-03 03:59:01 UTC
Created attachment 109568 [details] [review]
Bug 26361: switch TableSettings to ColumnSettings

Test Plan:
-Be on 20.05.x
-Go to returns.tt
-See the error Uncaught SyntaxError: expected expression, got keyword 'var'.
-Apply patch
-Reload returns.tt, no error
Comment 4 Fridolin Somers 2020-09-03 07:47:20 UTC
Created attachment 109580 [details] [review]
Bug 26361: switch TableSettings to ColumnSettings

Test Plan:
-Be on 20.05.x
-Go to returns.tt
-See the error Uncaught SyntaxError: expected expression, got keyword 'var'.
-Apply patch
-Reload returns.tt, no error

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 5 Fridolin Somers 2020-09-03 07:48:17 UTC
Backport error indeed.
Also needed to 19.11.x
Comment 6 Jonathan Druart 2020-09-03 08:23:54 UTC
Lucas, you need to setup a pre-push hook to catch occurrences of TableSettings in template files.
Comment 7 Jonathan Druart 2020-09-03 08:38:36 UTC
Created attachment 109587 [details] [review]
Bug 26361: switch TableSettings to ColumnSettings

Test Plan:
-Be on 20.05.x
-Go to returns.tt
-See the error Uncaught SyntaxError: expected expression, got keyword 'var'.
-Apply patch
-Reload returns.tt, no error

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Lucas Gass (lukeg) 2020-09-03 14:05:01 UTC
backported to 20.05.x for 20.05.04
Comment 9 Mason James 2020-09-05 06:48:05 UTC
(In reply to Fridolin SOMERS from comment #5)
> Backport error indeed.
> Also needed to 19.11.x

hi Aleisha, can you add this to 19.11.x branch
Comment 10 Aleisha Amohia 2020-09-06 23:53:27 UTC
backported to 19.11.x for 19.11.10
Comment 11 Jonathan Druart 2020-09-07 11:15:55 UTC
*** Bug 26399 has been marked as a duplicate of this bug. ***
Comment 12 Victor Grousset/tuxayo 2020-09-07 13:09:26 UTC
IIUC if bug 25940 is backported to oldoldstable/19.05 this bug should be backported at the same time.
Comment 13 Jonathan Druart 2020-09-07 13:43:25 UTC
(In reply to Victor Grousset/tuxayo from comment #12)
> IIUC if bug 25940 is backported to oldoldstable/19.05 this bug should be
> backported at the same time.

No, backport the original patch (the one from master), and correctly fix the merge conflict.
Comment 14 Andreas Jonsson 2020-09-18 10:18:37 UTC
Since the javascript code breaks completely on the returns view (which i believe will case a lot of confusion about reserved items) whould it not be appropriate to mark this as a blocker and post a message in the release notes of 19.11.09 and 20.05.03 to discourage libraries from installing or upgrading to these versions?
Comment 15 Katrin Fischer 2020-09-18 10:32:14 UTC
(In reply to Andreas Jonsson from comment #14)
> Since the javascript code breaks completely on the returns view (which i
> believe will case a lot of confusion about reserved items) whould it not be
> appropriate to mark this as a blocker and post a message in the release
> notes of 19.11.09 and 20.05.03 to discourage libraries from installing or
> upgrading to these versions?

The new maintenance release should be out within a few days now (around 22nd) - so this will be fixed soon. We haven't seen any libraries running into this in the chat and on the mailing list - so I hope that not too many have run into this. An email to the mailing list might come a little late now :(
Comment 16 Mason James 2020-09-18 20:12:21 UTC
(In reply to Katrin Fischer from comment #15)
> (In reply to Andreas Jonsson from comment #14)
> > Since the javascript code breaks completely on the returns view (which i
> > believe will case a lot of confusion about reserved items) whould it not be
> > appropriate to mark this as a blocker and post a message in the release
> > notes of 19.11.09 and 20.05.03 to discourage libraries from installing or
> > upgrading to these versions?
> 
> The new maintenance release should be out within a few days now (around
> 22nd) - so this will be fixed soon. We haven't seen any libraries running
> into this in the chat and on the mailing list - so I hope that not too many
> have run into this. An email to the mailing list might come a little late
> now :(

this patch has been added to 19.11.09-2 and 20.05.03-2 releases, so its fixed already :)
Comment 17 Katrin Fischer 2020-09-18 20:18:38 UTC
Awesome, thx Mason!
Comment 18 Andreas Jonsson 2020-09-19 07:49:09 UTC
(In reply to Katrin Fischer from comment #15)
> (In reply to Andreas Jonsson from comment #14)
> > Since the javascript code breaks completely on the returns view (which i
> > believe will case a lot of confusion about reserved items) whould it not be
> > appropriate to mark this as a blocker and post a message in the release
> > notes of 19.11.09 and 20.05.03 to discourage libraries from installing or
> > upgrading to these versions?
> 
> The new maintenance release should be out within a few days now (around
> 22nd) - so this will be fixed soon. We haven't seen any libraries running
> into this in the chat and on the mailing list - so I hope that not too many
> have run into this. An email to the mailing list might come a little late
> now :(

Our largest collaboration of libraries, which I upgraded on Thursday night, was affected by this.  We were only lucky to notice this as quickly as we did so only about 50 reserved items where affected.  But it could easily have been a thousand.

If the issue is likely to cause major problems to some libraries it would be a good idea to warn the community even if the maintenance release is just a few days away, in my opinion.
Comment 19 Andreas Jonsson 2020-09-19 07:50:23 UTC
(In reply to Mason James from comment #16)
> (In reply to Katrin Fischer from comment #15)
> > (In reply to Andreas Jonsson from comment #14)
> > > Since the javascript code breaks completely on the returns view (which i
> > > believe will case a lot of confusion about reserved items) whould it not be
> > > appropriate to mark this as a blocker and post a message in the release
> > > notes of 19.11.09 and 20.05.03 to discourage libraries from installing or
> > > upgrading to these versions?
> > 
> > The new maintenance release should be out within a few days now (around
> > 22nd) - so this will be fixed soon. We haven't seen any libraries running
> > into this in the chat and on the mailing list - so I hope that not too many
> > have run into this. An email to the mailing list might come a little late
> > now :(
> 
> this patch has been added to 19.11.09-2 and 20.05.03-2 releases, so its
> fixed already :)

Were are these releases announced?  I don't even see any tags for them on GitHub.
Comment 20 Katrin Fischer 2020-09-19 07:53:17 UTC
Are you building your own packages or are you using the community ones? I think this might have been fixed in the packages published, but not on git - could this be the issue?
Comment 21 Andreas Jonsson 2020-09-19 08:05:48 UTC
(In reply to Katrin Fischer from comment #20)
> Are you building your own packages or are you using the community ones? I
> think this might have been fixed in the packages published, but not on git -
> could this be the issue?

Yes, indeed we are building our own packages, because we have a few custom patches that we are using.

But the releases on the download page are 19.11.09 and 20.05.03 both from 2020-08-31, which is before this issue was reported.
Comment 22 Katrin Fischer 2020-09-20 21:56:59 UTC
> But the releases on the download page are 19.11.09 and 20.05.03 both from
> 2020-08-31, which is before this issue was reported.

I am not sure what happened there then with what Mason said. It's good to think about how to improve workflows for such hotfixes.