postnl / postnl-magento1-End-of-life

This is the official Magento 1 extension of PostNL.
12 stars 9 forks source link

Possible JS errors on the view order page in my account environment #49

Closed BarryBadpak closed 5 years ago

BarryBadpak commented 5 years ago

What is the purpose of your issue?


Description of your issue, suggested solution and other information

Viewing of orders in the customers account section can result in JS errors, the module templates try to access elements defined by Magento elements and insert additional DOM content into them. However these elements are retrieved and used without checking if an actual element was found. This check should be added, as the module itself can not guarantee that an element can be found for the following expression $$('div.col2-set div.col-2 div.box-content')[0]. This PR adds a truthful check around the statement where a call is made on this element, preventing JS errors from occurring in cases where template changes have been made to the Magento templates in such a way that these identifiers have changed.

I've proposed a fix for this in #48, in general this is good practise as well. Check for validity before using the element.

tig-dennisvanderhammen commented 5 years ago

As mentioned in the pull request, thank you for pointing this out! You can expect this to be changed in an upcoming release.

BarryBadpak commented 5 years ago

Thanks for the quick update Dennis!