I have a taxonomy reference field field_location_type
with terms: Term A, Term B.
Inside of my custom module, I'm setting up a presave function that will set a hidden field value depending on the term selected in field_location_type
.
I'm trying to log the current value of the field just to confirm i'm getting the right one, but there are no values displaying, like ...
function general_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
\Drupal::logger('general')->notice('here: ' . $entity->field_location_type->value);
}
How do i get the value of the select field field_location_type
?