Bug 10607 - JavaScript indexOf function not supported by IE 7 and 8
Summary: JavaScript indexOf function not supported by IE 7 and 8
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Browser compatibility (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 10541
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-17 16:10 UTC by Galen Charlton
Modified: 2016-12-05 21:23 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Galen Charlton 2013-07-17 16:10:09 UTC
The indexOf JavaScript function is not supported by IE 7 and 8.  This bug is a omnibus for replacing it in Koha JavaScript code.

Grepping indicates that the following files may be affected:

gmc@zadi:~/koha$ grep -rl indexOf koha-tmpl/intranet-tmpl/prog/en/{includes,modules,js}
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt
koha-tmpl/intranet-tmpl/prog/en/js/additem.js
koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js
koha-tmpl/intranet-tmpl/prog/en/js/acq.js
koha-tmpl/intranet-tmpl/prog/en/js/basket.js
koha-tmpl/intranet-tmpl/prog/en/js/datatables.js
gmc@zadi:~/koha$ grep -rl indexOf koha-tmpl/opac-tmpl/prog/en/{includes,modules,js}    
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tt
koha-tmpl/opac-tmpl/prog/en/js/browserid_include.js
koha-tmpl/opac-tmpl/prog/en/js/amazonimages.js
koha-tmpl/opac-tmpl/prog/en/js/basket.js
koha-tmpl/opac-tmpl/prog/en/js/datatables.js
koha-tmpl/opac-tmpl/prog/en/js/bakertaylorimages.js

The following external JavaScript library files may use it as well, but that isn't necessarily a problem, as they may be doing so in a cross-browser way:

gmc@zadi:~/koha$ grep -rl indexOf koha-tmpl/opac-tmpl/prog/en/lib
koha-tmpl/opac-tmpl/prog/en/lib/greybox/GreyBox_v5_5/greybox_source/auto_deco.js
koha-tmpl/opac-tmpl/prog/en/lib/greybox/GreyBox_v5_5/greybox_source/base/base.js
koha-tmpl/opac-tmpl/prog/en/lib/greybox/GreyBox_v5_5/greybox_source/base/AJS.js
koha-tmpl/opac-tmpl/prog/en/lib/greybox/AJS.js
koha-tmpl/opac-tmpl/prog/en/lib/greybox/gb_scripts.js
koha-tmpl/opac-tmpl/prog/en/lib/jquery/jquery.js
koha-tmpl/opac-tmpl/prog/en/lib/jquery/jquery-ui.js
koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.metadata.min.js
koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.highlight-3.js
koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js
gmc@zadi:~/koha$ grep -rl indexOf koha-tmpl/intranet-tmpl/prog/en/lib
koha-tmpl/intranet-tmpl/prog/en/lib/yui/container/container_core-debug.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/container/container_core.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/container/container-min.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/container/container.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/container/container-debug.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/container/container_core-min.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/yahoo-dom-event/yahoo-dom-event.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/utilities/utilities.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/menu/menu-min.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/menu/menu-debug.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/menu/menu.js
koha-tmpl/intranet-tmpl/prog/en/lib/yui/plugins/bubbling-min.js
koha-tmpl/intranet-tmpl/prog/en/lib/greybox/GreyBox_v5_5/greybox_source/auto_deco.js
koha-tmpl/intranet-tmpl/prog/en/lib/greybox/GreyBox_v5_5/greybox_source/base/base.js
koha-tmpl/intranet-tmpl/prog/en/lib/greybox/GreyBox_v5_5/greybox_source/base/AJS.js
koha-tmpl/intranet-tmpl/prog/en/lib/greybox/AJS.js
koha-tmpl/intranet-tmpl/prog/en/lib/greybox/gb_scripts.js
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.uitablefilter.js
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery-ui-timepicker-addon.js
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.columnFilter.js

[1] http://kangax.github.io/es5-compat-table/#Array.prototype.indexOf
Comment 1 Katrin Fischer 2013-07-17 16:34:51 UTC
I think one of the problems possibly related to the use of IndexOf is the inability to select irregularities when creating subscriptions in serials. I can't test it here as I don't have an old IE, so that's from my training notes.
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
Comment 2 Galen Charlton 2013-07-17 16:49:00 UTC
(In reply to Katrin Fischer from comment #1)
> I think one of the problems possibly related to the use of IndexOf is the
> inability to select irregularities when creating subscriptions in serials. I
> can't test it here as I don't have an old IE, so that's from my training
> notes.
> koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt

Based on my (and others) testing of the patch for bug 10541, this sort of thing can be tested in IE 9 or 10 by using "F12 developer tools" to set the browser mode to IE 7 or IE 8.
Comment 3 Katrin Fischer 2013-07-17 16:53:15 UTC
Cool, thx!
Comment 4 Galen Charlton 2013-12-05 16:46:15 UTC
I've found one template in the Bootstrap theme that is affected:

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt
Comment 5 David Cook 2014-05-30 01:10:44 UTC
Where IE emulation fails, you can always try an IE testing VM as well:

www.modern.ie

I've been using the Win 7 IE 8 recently and have no complaints. Mind you, they expire after a set period of time, so if it's not easy to "refresh" it...I'll be a bit cranky.
Comment 6 Owen Leonard 2016-02-22 18:49:11 UTC
I don't think we should not be spending time trying to support IE7 and 8 anymore.
Comment 7 Owen Leonard 2016-02-22 19:53:31 UTC
(In reply to Owen Leonard from comment #6)
> I don't think we should not be spending time trying to support IE7 and 8
> anymore.

That is, I don't think we should be spending time trying to support IE7 and 8 anymore.
Comment 8 David Cook 2016-04-11 00:05:42 UTC
(In reply to Owen Leonard from comment #7)
> That is, I don't think we should be spending time trying to support IE7 and
> 8 anymore.

I agree that there's no point in actively trying to support IE7 and IE8, although as someone who has to support IE7 and IE8 sometimes, I find it nice when people test and QA my code. What I mean to say is... in general we shouldn't claim to support IE7 or IE8 or make concerted efforts to do so... but I don't see why we can't fix individual issues as they arise if someone is willing to code a fix.

Personally, I haven't encountered this particular issue, so I have no interest in fixing it if I don't have to, but I don't know if we need to label it as a WONTFIX. 

(Relevant for anyone searching this in the future: 

Personally, I think it makes sense to use jQuery's "inArray", since we use a lot of jQuery and it's cross-platform. Obviously not very useful in the case of third-party libraries that we can't re-write.

Alternatively, we could use a polyfill:
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)