postcode-nl / PostcodeNl_Api_MagentoPlugin

A Magento plugin 1.9 that implements the Postcode.nl API for Dutch addresses
BSD 2-Clause "Simplified" License
21 stars 12 forks source link

Prevent an infinite loop when changing the country select #21

Closed markvds closed 9 years ago

markvds commented 9 years ago

Prevent an infinite loop when changing the country select and there is no 'NL' option in the select box

The script will result in an endless recursion when there is no option with the value 'NL' in the select element, as the value of the select is still empty after setting its value to 'NL'.

DaanBroekhof commented 9 years ago

Ah indeed, I guess we never tested in a situation where there is no 'NL' country option.

In which situation did this occur? Maybe a case where the country-list is somehow dynamic?

markvds commented 9 years ago

It occurred in a store view only for the Belgian market so the only available options were «empty» and BE. Of course, for this store view the whole PostcodeNL functionality has no purpose. Op 25 feb. 2015 14:11 schreef "Daan Broekhof" notifications@github.com:

Ah indeed, I guess we never tested in a situation where there is no 'NL' country option.

In which situation did this occur? Maybe a case where the country-list is somehow dynamic?

— Reply to this email directly or view it on GitHub https://github.com/postcode-nl/PostcodeNl_Api_MagentoPlugin/pull/21#issuecomment-75957004 .

DaanBroekhof commented 9 years ago

That makes sense, fix will be in next version. Thanks!