Skip to content

Commit 4361065

Browse files
[Backport to release/11.2] Fix the Checkout block rejecting 4-digit Argentine postcodes (#69662)
Fix the Checkout block rejecting 4-digit Argentine postcodes (#69658) Co-authored-by: Raluca Stan <ralucastn@gmail.com>
1 parent 4280079 commit 4361065

5 files changed

Lines changed: 22 additions & 8 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
Accept legacy four-digit Argentine postcodes in the Checkout block again.

‎plugins/woocommerce/client/blocks/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
"fast-deep-equal": "^3.1.3",
259259
"fast-sort": "^3.4.0",
260260
"html-react-parser": "3.0.4",
261-
"postcode-validator": "3.10.22",
261+
"postcode-validator": "3.9.2",
262262
"preact": "^10.24.2",
263263
"prop-types": "^15.8.1",
264264
"react-number-format": "5.4.5",

‎plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/utils/validation/test/is-postcode.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,17 @@ describe( 'isPostcode', () => {
197197
[ true, '2000', 'AU' ],
198198
[ false, '2000#', 'AU' ],
199199

200+
// Argentina uses the fallback too. The legacy four digit codes are
201+
// still in everyday use next to the lettered format; postcode-validator
202+
// 3.10 started rejecting them.
203+
[ true, '1213', 'AR' ],
204+
[ true, '7540', 'AR' ],
205+
[ true, 'C1213', 'AR' ],
206+
[ true, 'C1213ABC', 'AR' ],
207+
[ true, 'B7540', 'AR' ],
208+
[ false, '142', 'AR' ],
209+
[ false, 'I1213', 'AR' ],
210+
200211
// Unknown country codes — assumed valid since no regex applies.
201212
[ true, '12345', 'XX' ],
202213
[ true, 'anything', 'ZZ' ],

‎plugins/woocommerce/i18n/postcode-validation-rules.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"generatedFrom": {
33
"package": "postcode-validator",
4-
"version": "3.10.22"
4+
"version": "3.9.2"
55
},
66
"rules": {
77
"AT": {

‎pnpm-lock.yaml‎

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)