[Bug 14266] New: Replace trim() with $.trim() in opac-shareshelf.tt
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Bug ID: 14266 Summary: Replace trim() with $.trim() in opac-shareshelf.tt Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org At the moment, we use both jQuery's $.trim() and the regular Javascript trim() in our templates. You can find trim() in: - koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt - koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt You can find $.trim() in: - koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt The jQuery $.trim() appears perfectly cross-platform, but the Javascript trim() isn't supported in IE8 or earlier. It was only introduced in IE9. Since we already use jQuery everywhere, I don't see why we can't use $.trim() instead of trim(). At the moment, people using IE8 in the staff client (and I'm sure there are many of them) can't save patron categories. Javascript errors will prevent the submission of the page. -- I know we occasionally debate supporting older versions of IE, but this is a pretty easy win. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14265 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 39470 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39470&action=edit Replace trim() with $.trim() in opac-shareshelf.tt This patch replaces trim() with $.trim() which is supported in versions of IE older than IE9. _TEST PLAN_ Before applying patch: 0) Use IE 8 or Document Mode 8 in a newer IE using F12 Developer Tools 1) Set OpacAllowSharingPrivateLists to "Allow" in Global System Preferences 2) Create a private list in the OPAC 3) Add a record to the private list 4) Click "Share" or "Share list" on one of the list screens 5) Type in an email address and click "Send" 6) Note an error preventing the submission of the page (you can also see this in the console log) Apply the patch: 7) Hold shift + refresh the browser to update any Javascript cache 8) Try to "Share" the list again 9) Note that the form submit after clicking "Send" and that there are no errors -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |indradg@gmail.com --- Comment #2 from Indranil Das Gupta <indradg@gmail.com> --- (In reply to David Cook from comment #1)
Created attachment 39470 [details] [review] <snipped> 5) Type in an email address and click "Send" 6) Note an error preventing the submission of the page (you can also see this in the console log)
Strangely I couldn't reproduce the error on IE 8.0.6001.18702 There was no problem with form submission. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- (In reply to Indranil Das Gupta from comment #2)
Strangely I couldn't reproduce the error on IE 8.0.6001.18702 There was no problem with form submission.
Ah, my bad with the test plan. The form will still submit. It'll just produce a Javascript error along the way. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39470|0 |1 is obsolete| | --- Comment #4 from Indranil Das Gupta <indradg@gmail.com> --- Created attachment 39497 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39497&action=edit Replace trim() with $.trim() in opac-shareshelf.tt This patch replaces trim() with $.trim() which is supported in versions of IE older than IE9. Revised test plan ================= Before applying patch: 0) Use IE 8 or Document Mode 8 in a newer IE using F12 Developer Tools 1) Set OpacAllowSharingPrivateLists to "Allow" in Global System Preferences 2) Create a private list in the OPAC 3) Add a record to the private list 4) Click "Share" or "Share list" on one of the list screens 5) Type in an email address and click "Send" 6) Note the error in the console log 7) The page should submit Apply the patch: 7) Hold shift + refresh the browser to update any Javascript cache 8) Try to "Share" the list again 9) Note that the form submit after clicking "Send" and that there are no errors in the console log http://bugs.koha-community.org/show_bug.cgi?id=14266 Signed-off-by: Indranil Das Gupta <indradg@gmail.com> Remarks: Works as per revised test plan -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39509 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39509&action=edit [COUNTER-PATCH] Bug 14266: Trim the email address in the pl script The original concern of bug 14266 was to provide a compatibility for <IE9. But actually we don't need to trim the email address template side. It will even better to trim it in the perl script, so that the email will be trimed even if JS is disabled. Test plan: 1/ Share a list and does not provide any email address 2/ Submit => The form is not submited, no alert/message is displayed (same as before this patch). 3/ Share a list and provide an email address with spaces before and after 4/ Submit => You should receive the email -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- David, could you please have a look at my counter patch? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #6)
David, could you please have a look at my counter patch?
Looks good to me :). I'm not attached to trim on the client side. I'm not really working on Koha for the rest of the week, but I could test this next week if no one does before then. Indranil, you could get another sign off in ;) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39509|0 |1 is obsolete| | --- Comment #8 from Indranil Das Gupta <indradg@gmail.com> --- Created attachment 39647 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39647&action=edit Bug 14266: Trim the email address in the pl script The original concern of bug 14266 was to provide a compatibility for <IE9. But actually we don't need to trim the email address template side. It will even better to trim it in the perl script, so that the email will be trimed even if JS is disabled. Test plan: 1/ Share a list and does not provide any email address 2/ Submit => The form is not submited, no alert/message is displayed (same as before this patch). 3/ Share a list and provide an email address with spaces before and after 4/ Submit => You should receive the email Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Test output compliant with expected test plan outcome. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 39701 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39701&action=edit [PASSED QA] Bug 14266: Trim the email address in the pl script The original concern of bug 14266 was to provide a compatibility for <IE9. But actually we don't need to trim the email address template side. It will even better to trim it in the perl script, so that the email will be trimed even if JS is disabled. Test plan: 1/ Share a list and does not provide any email address 2/ Submit => The form is not submited, no alert/message is displayed (same as before this patch). 3/ Share a list and provide an email address with spaces before and after 4/ Submit => You should receive the email Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Test output compliant with expected test plan outcome. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Attachment #39647|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Having trouble attaching first patch. Consider both to have passed qa. It just gets overwritten anyway. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Thankas David! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Status|Pushed to Master |Pushed to Stable --- Comment #12 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.20.x will be in 3.20.1 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #13 from Liz Rea <wizzyrea@gmail.com> --- Patch pushed to 3.18.x will be in 3.18.08 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14266 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #14 from Mason James <mtj@kohaaloha.com> --- Pushed to 3.16.x, will be in 3.16.13 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org