Bug 5862

Summary: Incompatibility in ajax.js with "localName" for Internet Explorer
Product: Koha Reporter: Vicente Seguí Serrán <vicente>
Component: Browser compatibilityAssignee: Vicente Seguí Serrán <vicente>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: P5 - low CC: chris, fcapovilla
Version: rel_3_2   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Use "nodeName" for IE

Description Vicente Seguí Serrán 2011-03-14 08:47:48 UTC
It has been detected an incompatibility with Internet Explorer in the ajax.js file that cause a javascript error for this browser that prevents proper operation.

The error is located in the lines:

40              switch ( this.localName.toLowerCase() ) {
65              switch ( this.localName.toLowerCase() ) {

The error occurs because the "localName" is not supported by Internet Explorer and returns "undefined".
Comment 1 Vicente Seguí Serrán 2011-03-14 09:04:23 UTC
Created attachment 3291 [details] [review]
Use "nodeName" for IE

The solution is based on detecting this behavior that occurs in Internet Explorer and use "nodeName", which is equivalent to "localName" for Internet Explorer.

Ajax.js file will be modified as follows:

40              var selector_type = this.localName;
                if (selector_type == undefined) selector_type = this.nodeName; // IE only
                switch ( selector_type.toLowerCase() ) { 
                
67              var selector_type = this.localName;
                if (selector_type == undefined) selector_type = this.nodeName; // IE only
                switch ( selector_type.toLowerCase() ) {
Comment 2 Owen Leonard 2011-03-18 15:00:50 UTC
Some additional information required to properly test this patch:

 - ajax.js is used in one place, preferences.pl in the staff client
 - If Internet Explorer is configured to prompt you on JavaScript errors, it will give you an alert when you load the preferences page:

"Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)
Timestamp: Fri, 18 Mar 2011 14:59:12 UTC


Message: Expected identifier, string or number
Line: 11
Char: 9
Code: 0
URI: /intranet-tmpl/prog/en/js/ajax.js"
Comment 3 Chris Cormack 2011-03-20 23:01:06 UTC
Pushed, please test
Comment 4 Frédérick Capovilla 2011-03-31 22:01:03 UTC
*** Bug 6010 has been marked as a duplicate of this bug. ***