I've got a list of terms which I need to add or update programmatically based on their name.
To check if the term exists I'm using a combination of
taxonomy_vocabulary_machine_name_load to get the
taxonomy_get_term_by_name to get the term if exists. Otherwise I'm creating the term as
When I save the term normal field (using
taxonomy_term_save) in format like
$term->field_address[$term->language]['value'] = 'some address data' everything works just fine, but when it comes to save relations nothing is begin saved.
I'm saving relations as
$term->field_realization[$term->language] = array( 'target_type' => 'taxonomy_term', 'value' => $another_term->tid);.
$term->language = 'und'; and
$another_term is a term which belongs to right field Vocabulary declared in Administer.
What am I doing wrong?