cancel
Showing results for 
Search instead for 
Did you mean: 

use of arrow function in Magento 1.9.4.4 causing issues with internet explorer

use of arrow function in Magento 1.9.4.4 causing issues with internet explorer

In Magento 1.9.4.4, I experienced an issue when merging javascript files.

 

one of the functions found in the file js/varien/js.js, called buttonDisabler, has functionality where a forEach call is using an arrow function as its callback function.

 

this causes issues with Internet Explorer 11 as it will stop loading everything after it, and thus may cause the website to behave abnormally depending on what type of customizations are used.

 

I was able to fix this by changing the arrow function into a normal function expression.

 

How can I report this issue to Magento?

there seems to be no github associated to Magento 1

3 REPLIES 3

Re: use of arrow function in Magento 1.9.4.4 causing issues with internet explorer

Hello @paulrod 

 

As i know there is no open git repo for magento 1 and as it dis-continue from 2020

 

so fix into your project or create patch into your project and share that patch into this ticket so somebody need they can use that patch and applied it.

 

Hope it will help you


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: use of arrow function in Magento 1.9.4.4 causing issues with internet explorer

Hi Paul

 

I have the same issue. Could you elaborate on the solution?

 

There's an unofficial Magento Long Term Support here, where you can suggest this:
https://github.com/OpenMage/magento-lts

 

Re: use of arrow function in Magento 1.9.4.4 causing issues with internet explorer

on the file js/varien/js.js, at the bottom of it, you will find the following code:

function buttonDisabler() {
const buttons = document.querySelectorAll('button.save');
buttons.forEach(button => button.disabled = true);
}

the code uses ES6 syntax, which IE does not support.

 

change it to:

function buttonDisabler() {
const buttons = document.querySelectorAll('button.save');
buttons.forEach(function(button) {button.disabled = true;});
}

 

for better compatibility.

 

it looks like somebody already created a pull request about it.