Skip to content
Snippets Groups Projects
Commit ff644421 authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-4947: updating address as now we have null default values, and no need...

ISTWCMS-4947: updating address as now we have null default values, and no need to look at address values
parent e66a6335
No related branches found
No related tags found
1 merge request!127ISTWCMS-4947: ensure that location address and map either has values or null
......@@ -316,36 +316,7 @@ class UWService implements UWServiceInterface {
break;
case 'address':
// Set the address initially to null, if there are
// address values, then will be replaced.
$node_data['address'] = NULL;
// Get the address value. There will always be a
// country code and administrative area, so we will
// have to check that there are at least values in
// address that we are using.
$address = $node->$data->getValue()[0];
// Values that we are looking for so that the address
// can be displayed. If there is at least a value in
// this list, we display the address.
$address_values = [
'locality',
'postal_code',
'address_line1',
'address_line2',
];
// Step through each of the address values and check
// if there is a value in the field, if there is
// set the node data variable and exit the loop to
// save computational time.
foreach ($address_values as $address_value) {
if ($address[$address_value]) {
$node_data['address'] = $address;
break;
}
}
$node_data['address'] = $node->$data->getValue()[0];
break;
case 'author':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment