Skip to content

Commit e7bca7b

Browse files
committed
Bug #60410: Fix stored shipping address not initialized
* Update version and changelog.
1 parent edfd7f2 commit e7bca7b

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

assets/js/postcode-eu-autofill.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
return; // Already initialized.
2424
}
2525

26-
const container = $(this);
26+
const container = $(this),
27+
addressType = container.find('#billing_city').length === 0 ? 'shipping' : 'billing';
28+
29+
storedAddresses[addressType] ??= new StoredAddress(addressType);
2730

2831
if (false === container.is(':visible'))
2932
{
@@ -32,9 +35,6 @@
3235

3336
initializedElements.add(this);
3437

35-
const addressType = container.find('#billing_city').length === 0 ? 'shipping' : 'billing';
36-
storedAddresses[addressType] ??= new StoredAddress(addressType);
37-
3838
if (settings.displayMode === 'default')
3939
{
4040
addFormattedAddressOutput(container);

postcode-eu-address-validation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Postcode.eu Address Validation
44
* Plugin URI: https://www.postcode.eu/products/address-api/implementation
55
* Description: Address autocomplete and validation using the Postcode.eu API.
6-
* Version: 2.6.1
6+
* Version: 2.6.2
77
* Author: Postcode.nl
88
* Author URI: https://www.postcode.nl
99
* License: FreeBSD license

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=== Postcode.eu Address Validation ===
22
Contributors: postcodenl
33
Tags: address validation, address autocomplete, postcode api, address api, postcode check
4-
Stable tag: 2.6.1
4+
Stable tag: 2.6.2
55
Tested up to: 6.8
66
License: FreeBSD license
77
License URI: https://directory.fsf.org/wiki/License:BSD-2-Clause-FreeBSD
@@ -86,6 +86,9 @@ For more details on the Postcode.eu API and how to obtain an account, please vis
8686

8787
== Changelog ==
8888

89+
= 2.6.2 =
90+
* Fix usage of potentially uninitialized shipping address.
91+
8992
= 2.6.1 =
9093
* Fix compatibility with single billing and shipping form.
9194

src/PostcodeNl/AddressAutocomplete/Main.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Main
1414
public const NAME = 'Postcode.eu Address Validation';
1515

1616
/** @var string The version number of the plugin should be equal to the commented version number in ../../../postcode-eu-address-validation.php */
17-
public const VERSION = '2.6.1';
17+
public const VERSION = '2.6.2';
1818

1919
/** @var string Script handle of the autocomplete library. */
2020
public const AUTOCOMPLETE_LIBRARY_HANDLE = 'postcode-eu-autocomplete-address-library';

0 commit comments

Comments
 (0)