- Issue created by @dianacastillo
When i run the following code i get "bad gateway " with no error message. with xdebug everything looks fine until i get to the ->save line and then it crashes. is this code correct to update the address field?
$profile_id = 29604;
$profile_object = Profile::load($profile_id);
$field_city = $profile_object->get('field_city')->value;
$field_state = $profile_object->get('field_state')->value;
$field_postal_code = $profile_object->get('field_postal_code')->value;
$addresses = $profile_object->get('field_address');
$addresses->setValue(array(
'country_code' => 'US',
'locality' => $field_city,
'postal_code' => $field_postal_code,
'administrative_area' => $field_state
));
$profile_object->save($profile_object);
Active
2.0
Code