When there is a transfer in progress the modal 'Print transfer slip' button has both 'print' and 'openWin' classes The latter takes care of launching the popup - the former is not needed because there is no form to submit because the transfer exists JS error: Uncaught TypeError: this.form is null <anonymous> http://localhost:8081/cgi-bin/koha/circ/returns.pl:1093 jQuery 9 <anonymous> http://localhost:8081/cgi-bin/koha/circ/returns.pl:1088 jQuery 8
Created attachment 119588 [details] [review] Bug 28148: Remove 'print' class from 'Print transfer slip' when transfer exists The 'print' class triggers JS to create the transfer and update a form When a transfer exists we have no form and use 'openWin' to trigger the print Also, I remove a stray '1' in the template To test: 1 - Set AutomaticItemReturn to "Don't" 2 - Check in an item from another branch 3 - Confirm the transfer 4 - Check it in again 5 - Click 'Print slip' 6 - Note error in console: Uncaught TypeError: this.form is null 7 - apply patch 8 - Repeat 9 - No error!
Created attachment 119589 [details] [review] Bug 28148: Remove 'print' class from 'Print transfer slip' when transfer exists The 'print' class triggers JS to create the transfer and update a form When a transfer exists we have no form and use 'openWin' to trigger the print Also, I remove a stray '1' in the template To test: 1 - Set AutomaticItemReturn to "Don't" 2 - Check in an item from another branch 3 - Confirm the transfer 4 - Check it in again 5 - Click 'Print slip' 6 - Note error in console: Uncaught TypeError: this.form is null 7 - apply patch 8 - Repeat 9 - No error! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This does resolve the JS error and allows slips to still be printed. There looks to be other cases in the code, but I can't for the life of me work out how to trigger them.. Signing off for now.. other stuff can be handled in other bugs... this code really needs a concerted cleanup.. it's incredibly difficult to follow.
Created attachment 119592 [details] [review] Bug 28148: Remove 'print' class from 'Print transfer slip' when transfer exists The 'print' class triggers JS to create the transfer and update a form When a transfer exists we have no form and use 'openWin' to trigger the print Also, I remove a stray '1' in the template To test: 1 - Set AutomaticItemReturn to "Don't" 2 - Check in an item from another branch 3 - Confirm the transfer 4 - Check it in again 5 - Click 'Print slip' 6 - Note error in console: Uncaught TypeError: this.form is null 7 - apply patch 8 - Repeat 9 - No error! Signed-off-by: Owen Leonard <oleonard@myacpl.org>
It looks like we have a sign-off from Owen now too - Martin, do you want to add your line again counting for QA?
Created attachment 120234 [details] [review] Bug 28148: Remove 'print' class from 'Print transfer slip' when transfer exists The 'print' class triggers JS to create the transfer and update a form When a transfer exists we have no form and use 'openWin' to trigger the print Also, I remove a stray '1' in the template To test: 1 - Set AutomaticItemReturn to "Don't" 2 - Check in an item from another branch 3 - Confirm the transfer 4 - Check it in again 5 - Click 'Print slip' 6 - Note error in console: Uncaught TypeError: this.form is null 7 - apply patch 8 - Repeat 9 - No error! Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Restored SO line and converted to QA :) Passed
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.06
Pushed to 20.05.x for 20.05.12
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.