JavaScript in a few templates uses the now-deprecated .live() method. This should be replaced with .on() in preparation for an upgrade of jQuery.
Created attachment 25744 [details] [review] Bug 11877 - Eliminate use of deprecated jQuery .live() method As of jQuery 1.9 the .live() method has been removed. A few templates contain JavaScript which uses it. It can be easily replaced with .on(). This patch makes the correction. To test, apply the patch and test the following pages: - In the staff client, Administration -> OAI sets configuration: Define mappings for an existing set. You should be able to add rows by clicking the "OR" button. You should be able to delete or clear any line by clicking the "Delete" link. - In the staff client, view the details for any patron and click the "Change password" button: In the change password form click the link to fill the password fields with a random password. This link should work correctly. - If necessary enable OpacRenewalAllowed in system preferences. Log in to the OPAC as a patron who has checkouts. On the patron summary page (opac-user.pl) look for the "renew selected" and "renew all" links at the top of the table of checkouts. Both these links should work correctly. Test in prog and bootstrap themes.
FYI, I'll be referring to this page for further updates: http://jquery.com/upgrade-guide/1.9/
Comment on attachment 25744 [details] [review] Bug 11877 - Eliminate use of deprecated jQuery .live() method Review of attachment 25744 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ +40,4 @@ > } > return valid; > }); > + $("body").on("click","#renewselected_link",function(){ IS there a reason to prefer this way instead of: $("#renewselected_link").on("click", function(){ ?
> IS there a reason to prefer this way instead of: > $("#renewselected_link").on("click", function(){ ".click(function(){" is an shortcut for ".on("click",function(){", so most of the time the two are completely interchangeable. In this case we need to use ".on()" because we're attaching an event to an element which has not yet been created. The use of ".on()" quoted above means, "For all existing and future instances of '#renewselected_link' which are descendents of "body," attach this click handler." http://api.jquery.com/on/
I found a problem with step 2: How to repruduce: Click on "Change password" It displays the form "Change unsername and/or password for e.g. Edna Acosta Field "New username" is filled with usernumber (?): 23529001000463 (Would expect the user name here, not the number - but I think this is not related to this bug?) Then I click on "Click to fill with randoly generated password" Password fields are filled with new value, e.g. 'xcJ' (OK) Then I clear the password fields and click again for password suggestion Result: Password fields stay empty. (Would expect new suggstion.) Console says: "Kein Element gefunden (No element found)" file:///C:/Users/ApDAta/Roaming/Mozilla/Firefox/o1dv3kga.default/clipdat2.rdf I tested with Chrome as well, same behaviour.
Problem with step 2 exists without patch as well. Will sign off on this patch and file an other bug for step 2
Created attachment 25771 [details] [review] Bug 11877 - Eliminate use of deprecated jQuery .live() method As of jQuery 1.9 the .live() method has been removed. A few templates contain JavaScript which uses it. It can be easily replaced with .on(). This patch makes the correction. To test, apply the patch and test the following pages: - In the staff client, Administration -> OAI sets configuration: Define mappings for an existing set. You should be able to add rows by clicking the "OR" button. You should be able to delete or clear any line by clicking the "Delete" link. - In the staff client, view the details for any patron and click the "Change password" button: In the change password form click the link to fill the password fields with a random password. This link should work correctly. - If necessary enable OpacRenewalAllowed in system preferences. Log in to the OPAC as a patron who has checkouts. On the patron summary page (opac-user.pl) look for the "renew selected" and "renew all" links at the top of the table of checkouts. Both these links should work correctly. Test in prog and bootstrap themes.
Created attachment 25772 [details] [review] [Signed-off] Bug 11877 - Eliminate use of deprecated jQuery .live() method As of jQuery 1.9 the .live() method has been removed. A few templates contain JavaScript which uses it. It can be easily replaced with .on(). This patch makes the correction. To test, apply the patch and test the following pages: - In the staff client, Administration -> OAI sets configuration: Define mappings for an existing set. You should be able to add rows by clicking the "OR" button. You should be able to delete or clear any line by clicking the "Delete" link. - In the staff client, view the details for any patron and click the "Change password" button: In the change password form click the link to fill the password fields with a random password. This link should work correctly. - If necessary enable OpacRenewalAllowed in system preferences. Log in to the OPAC as a patron who has checkouts. On the patron summary page (opac-user.pl) look for the "renew selected" and "renew all" links at the top of the table of checkouts. Both these links should work correctly. Test in prog and bootstrap themes. Followed test plan. Same behaviour as without patch, i.e. patch OK Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 26377 [details] [review] [PASSED QA] Bug 11877 - Eliminate use of deprecated jQuery .live() method As of jQuery 1.9 the .live() method has been removed. A few templates contain JavaScript which uses it. It can be easily replaced with .on(). This patch makes the correction. To test, apply the patch and test the following pages: - In the staff client, Administration -> OAI sets configuration: Define mappings for an existing set. You should be able to add rows by clicking the "OR" button. You should be able to delete or clear any line by clicking the "Delete" link. - In the staff client, view the details for any patron and click the "Change password" button: In the change password form click the link to fill the password fields with a random password. This link should work correctly. - If necessary enable OpacRenewalAllowed in system preferences. Log in to the OPAC as a patron who has checkouts. On the patron summary page (opac-user.pl) look for the "renew selected" and "renew all" links at the top of the table of checkouts. Both these links should work correctly. Test in prog and bootstrap themes. Followed test plan. Same behaviour as without patch, i.e. patch OK Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and QA script, works as described. No Javasript errors found. Note: The buttons on the form show up, even if no item shows the checkbox. In my case the problem was that I had 0 renewals allowed in the circulation rules. Maybe we could hide them, if no item can be renewed.
Pushed to master. Thanks, Owen!
Pushed to 3.14.x, will be in 3.14.08
Pushed to 3.12.x, will be in 3.12.13