diff -u b/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php --- b/core/modules/taxonomy/src/TermForm.php +++ b/core/modules/taxonomy/src/TermForm.php @@ -47,6 +47,9 @@ $tree = $taxonomy_storage->loadTree($vocabulary->id()); $options = array('<' . $this->t('root') . '>'); + if (empty($parent)) { + $parent = array(0); + } foreach ($tree as $item) { if (!in_array($item->tid, $exclude)) { @@ -106,8 +109,10 @@ // Prevent leading and trailing spaces in term names. $term->setName(trim($term->getName())); - // Assign parents with proper delta values starting from 0. - $term->parent = array_keys($form_state->getValue('parent')); + // Assign parents with proper delta values starting from 0 and filter out + // the pre-selected root as it will not be saved (target_id = 0) and will + // only cause hasTranslationChanges to return a false result. + $term->parent = array_filter(array_keys($form_state->getValue('parent'))); return $term; }