[x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
Changes proposed in this Pull Request:
Fixes a fatal error when trying to generate orders. Some countries may have an empty "default_locale" property. In which case, this would throw a fatal (at least in PHP 8).
There's actually, only one case of this here, so I guess I was "lucky" to hit this. This issue should be fixed separately in Woo itself, but checking here to avoid a fatal wouldn't be bad either IMO.
How to test the changes in this Pull Request:
Check out trunk
Run wp eval "var_dump( WC\SmoothGenerator\Generator\CustomerInfo::generate_person('MV') );"
See fatal
Check out this branch
Run wp eval "var_dump( WC\SmoothGenerator\Generator\CustomerInfo::generate_person('MV') );"
See success
Other information:
[x] Have you added an explanation of what your changes do and why you'd like us to include them?
[ ] Have you written new tests for your changes, as applicable?
[ ] Have you successfully run tests with your changes locally?
Changelog entry
Fix fatal when generating a large amount of orders, which increases the chances of hitting the empty locale issue.
FOR PR REVIEWER ONLY:
[ ] I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.
All Submissions:
Changes proposed in this Pull Request:
Fixes a fatal error when trying to generate orders. Some countries may have an empty "default_locale" property. In which case, this would throw a fatal (at least in PHP 8).
There's actually, only one case of this here, so I guess I was "lucky" to hit this. This issue should be fixed separately in Woo itself, but checking here to avoid a fatal wouldn't be bad either IMO.
How to test the changes in this Pull Request:
wp eval "var_dump( WC\SmoothGenerator\Generator\CustomerInfo::generate_person('MV') );"
wp eval "var_dump( WC\SmoothGenerator\Generator\CustomerInfo::generate_person('MV') );"
Other information:
Changelog entry
FOR PR REVIEWER ONLY: