According to https://jquery.com/upgrade-guide/1.9/#attr-versus-prop- .attr() is no longer correct to access the checked state of a checkbox.
Created attachment 50119 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'checked' According to https://jquery.com/upgrade-guide/1.9/#attr-versus-prop- .attr() is no longer correct to access the checked state of a checkbox. This patch do the following replacements: .attr('checked') => .prop('checked') .attr('checked, '') => .prop('checked', false) .attr('checked, 'checked') => .prop('checked', true) .attr('checked', boolValue) => .prop('checked', boolValue) .removeAttr('checked') => .prop('checked', false) .attr('checked') == 'checked' => .is(':checked')
QA tools complain at 2 places: koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc forbidden pattern: tab char (line 6) koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt forbidden pattern: tab char (line 169)
Created attachment 50177 [details] [review] Bug 16238: QA fix: remove tab characters
Created attachment 50193 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'checked' According to https://jquery.com/upgrade-guide/1.9/#attr-versus-prop- .attr() is no longer correct to access the checked state of a checkbox. This patch do the following replacements: .attr('checked') => .prop('checked') .attr('checked, '') => .prop('checked', false) .attr('checked, 'checked') => .prop('checked', true) .attr('checked', boolValue) => .prop('checked', boolValue) .removeAttr('checked') => .prop('checked', false) .attr('checked') == 'checked' => .is(':checked') Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 50194 [details] [review] Bug 16238: QA fix: remove tab characters Signed-off-by: Marc Véron <veron@veron.ch>
What about the others occurrences? I have found some others at the OPAC: git grep '\.attr' **/*.tt|grep "'checked'"
(In reply to Jonathan Druart from comment #6) > What about the others occurrences? > I have found some others at the OPAC: > git grep '\.attr' **/*.tt|grep "'checked'" I don't know how I could have missed so many of them. I'll provide a followup
(In reply to Julian Maurice from comment #7) > (In reply to Jonathan Druart from comment #6) > > What about the others occurrences? > > I have found some others at the OPAC: > > git grep '\.attr' **/*.tt|grep "'checked'" > I don't know how I could have missed so many of them. I'll provide a followup In fact, it's completely normal, bug 15883 only upgrades jQuery for staff interface, so no changes required in OPAC
What do you only fix checked? There are also disabled and readonly.
s/What/Why
(In reply to Jonathan Druart from comment #9) > Why do you only fix checked? > There are also disabled and readonly. No particular reason. I suppose this should be done as well
Created attachment 50209 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'disabled'
Created attachment 50210 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'readonly'
Sorry, does not apply: Applying: Bug 16238: Use .prop() instead of .attr() for 'checked' Applying: Bug 16238: QA fix: remove tab characters Applying: Bug 16238: Use .prop() instead of .attr() for 'disabled' Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
That merge problem isn't very serious. I was able to correct it while testing, but I'm still going through all the changes before I can sign off.
Created attachment 50565 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'checked' According to https://jquery.com/upgrade-guide/1.9/#attr-versus-prop- .attr() is no longer correct to access the checked state of a checkbox. This patch do the following replacements: .attr('checked') => .prop('checked') .attr('checked, '') => .prop('checked', false) .attr('checked, 'checked') => .prop('checked', true) .attr('checked', boolValue) => .prop('checked', boolValue) .removeAttr('checked') => .prop('checked', false) .attr('checked') == 'checked' => .is(':checked') Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 50566 [details] [review] Bug 16238: QA fix: remove tab characters Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 50567 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'disabled'
Created attachment 50568 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'readonly'
Patches rebased on master
Created attachment 50580 [details] [review] [SIGNED-OFF] Bug 16238: Use .prop() instead of .attr() for 'checked' According to https://jquery.com/upgrade-guide/1.9/#attr-versus-prop- .attr() is no longer correct to access the checked state of a checkbox. This patch do the following replacements: .attr('checked') => .prop('checked') .attr('checked, '') => .prop('checked', false) .attr('checked, 'checked') => .prop('checked', true) .attr('checked', boolValue) => .prop('checked', boolValue) .removeAttr('checked') => .prop('checked', false) .attr('checked') == 'checked' => .is(':checked') Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 50581 [details] [review] [SIGNED-OFF] Bug 16238: QA fix: remove tab characters Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 50582 [details] [review] [SIGNED-OFF] Bug 16238: Use .prop() instead of .attr() for 'disabled' Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 50583 [details] [review] [SIGNED-OFF] Bug 16238: Use .prop() instead of .attr() for 'readonly' Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 50584 [details] [review] Bug 16238 [Follow-up] Upgrade jQuery in staff client: use .prop() instead of .attr() This patch corrects some tabs which should have been replaced with spaces. To test, diff against the previous commit with the '-w' flag. There should be no visible changes.
Created attachment 50734 [details] [review] [SIGNED-OFF] Bug 16238 [Follow-up] Upgrade jQuery in staff client: use .prop() instead of .attr() This patch corrects some tabs which should have been replaced with spaces. To test, diff against the previous commit with the '-w' flag. There should be no visible changes. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Space changes, no errors.
Created attachment 50737 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'checked' According to https://jquery.com/upgrade-guide/1.9/#attr-versus-prop- .attr() is no longer correct to access the checked state of a checkbox. This patch do the following replacements: .attr('checked') => .prop('checked') .attr('checked, '') => .prop('checked', false) .attr('checked, 'checked') => .prop('checked', true) .attr('checked', boolValue) => .prop('checked', boolValue) .removeAttr('checked') => .prop('checked', false) .attr('checked') == 'checked' => .is(':checked') Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 50738 [details] [review] Bug 16238: QA fix: remove tab characters Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 50739 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'disabled' Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 50740 [details] [review] Bug 16238: Use .prop() instead of .attr() for 'readonly' Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 50741 [details] [review] Bug 16238 [Follow-up] Upgrade jQuery in staff client: use .prop() instead of .attr() This patch corrects some tabs which should have been replaced with spaces. To test, diff against the previous commit with the '-w' flag. There should be no visible changes. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Space changes, no errors. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for the 16.05 release. Thanks Julian!