Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I added this code to track_field_changes_ccompare_field and so far it seems to work. After I get this tested I'll make a patch.
case 'addressfield':
for ($i = 0; $i < count($new_field); $i++) {
//do a compare of each part of address field
// first get a list of the address parts
$address_items = array_keys($new_field[$i]); // use $new_field in case something has change in the address definition
foreach ($address_items as $address_item) {
if ( $address_item <> 'data' ) {
if ( empty($new_field[$i][$address_item] ) ) {
if ( array_key_exists($address_item, $old_field[$i]) ) {
if ( ! empty($old_field[$i][$address_item]) ) {
return FALSE;
}
} else {
return FALSE;
}
} else {
if ( empty($old_field[$i][$address_item]) ) {
return FALSE;
} else {
if ( $old_field[$i][$address_item] <> $new_field[$i][$address_item] ) {
return FALSE;
}
}
}
}
}
}
// if we made it this far, no changes
return TRUE;
Comments
Comment #1
GemQueen commentedI added this code to track_field_changes_ccompare_field and so far it seems to work. After I get this tested I'll make a patch.
Comment #2
MattWithoos commentedThanks GemQueen, have tested and confirmed it's working. Will be arriving in 7.x-1.6
Comment #3
GemQueen commentedI don't think this made it in - I just downloaded 7.x-1.6 and unless I'm missing something, the addressfield code isn't there.
Comment #4
MattWithoos commentedFollowing on from the issue whereby people's contributions did not appear in the 1.6 release, I can confirm I have readded this for inclusion in 1.7.