benkeen / generatedata

A powerful, feature-rich, random test data generator.
https://generatedata.com
2.21k stars 611 forks source link

"region is undefined" #809

Closed ryguy40 closed 1 year ago

ryguy40 commented 1 year ago

I found a bug. Steps to reproduce:

1) Private window 2) Go to https://generatedata.com/ 3) Choose "street address" and select any format 4) Open developer console (F12) and monitor the console for the rest of the steps 5) Add city 6) Add region 7) Add zip 8) Add country 9) Select "United States" in country selection 10) Change "Any region" on line 3 to "country row" to match the country (should be row #5) 11) De-select "Full" format 12) Select "Short" format 13) On City row, change "Any city" to region row (should be row #3) 14) On zip row, change "Any format" to "region row" (should be row #3) ** A series of errors should appear in the console:

TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object TypeError: region is undefined DT-PostalZip.generator-8f4b66730aebbcc088fd8eafe9297a5a.js:1:1717 uncaught exception: Object

I am not certain all of the steps are necessary this is just what I logged in my attempt to reproduce. As I was going through, I'm pretty sure it relates to "short" region codes and zip code lookup. Like the zip code generator is expecting a full region name instead of a short name.

benkeen commented 1 year ago

Good catch! Thanks for the detailed steps, I was able to reproduce. I'll look into this for the next release.

ryguy40 commented 1 year ago

Happy to help. Great program. Been using for years (I used to have it installed on a local WAMP server and used it regularly) but I contributed yesterday for first time.

benkeen commented 1 year ago

Like the zip code generator is expecting a full region name instead of a short name.

Yup, this was exactly right. Oops.