\Drupal::logger('flat_taxonomy')->warning('Illegal parent %parent_tid for the term %name as vocabulary is flat. Parent has been updated.',array('%parent_tid'=>$term->parent,'%name'=>$term->name));
drupal_set_message($this->t('Illegal parent %parent_tid for the term %name as vocabulary is flat. Parent has been updated.',array('%parent_tid'=>$term->parent,'%name'=>$term->name)),'warning');
\Drupal::logger('flat_taxonomy')->warning('Illegal parent %parent_tid for the term %name as vocabulary is flat. Parent has been updated.',array('%parent_tid'=>$term->parent->target_id,'%name'=>$term->name->value));
drupal_set_message(t('Illegal parent %parent_tid for the term %name as vocabulary is flat. Parent has been updated.',array('%parent_tid'=>$term->parent->target_id,'%name'=>$term->name->value)),'warning');
// @TODO: Update the term weight so it is ordered after the parent.