netresearch / dhl-module-ui

Module for providing the presentation layer within the Magento application for custom functionality
Open Software License 3.0
3 stars 0 forks source link

Fix IE 11 compatibility #1

Closed sprankhub closed 4 years ago

sprankhub commented 4 years ago

This PR replaces Array.find with _.find. Array.find is not supported by old browsers like IE. You already use _.find at various other places, so replacing these two problematic occurrences of Array.find with _.find is the right way to fix this IMHO.

Even though this is a tiny change, please mind that it is currently untested.

ngolatka commented 4 years ago

internal ref: DHLGW-946

powli commented 4 years ago

@sprankhub Thanks for your contribution, we will evaluate and test the changes internally and get back to you.

sprankhub commented 4 years ago

Thanks @ngolatka! Just for our planning... What is the expected time frame for that?

sprankhub commented 4 years ago

I just tested this and can confirm that it works as expected.

mam08ixo commented 4 years ago

Thank you for your contribution, much appreciated!

ngolatka commented 4 years ago

Some (indirectly related) background information for those who may wonder "why does the above problem occur when DHL Shipping is not even enabled for checkout"?

The answer, thankfully provided by @mam08ixo

Due to the carrier-agnostic nature of the core/ui packages, the JS code will always run. If DHL Paket is disabled for checkout, the frontend code will still check if there is any other carrier to offer checkout services. If for instance only "Flatrate" is enabled, the code will find out that there is nothing to display and carry on. But it will perform the check, hence the code in question was and will remain executed.