UUID is not set to new created term.

This code is used when a new term is created, it should include the UUID:

Term::create([
  'vid' => $vid,
  'langcode' => $taxonomy['langcode'],
  'name' => $taxonomy['name'],
  'description' => [
    'value' => $taxonomy['description__value'],
    'format' => $taxonomy['description__format'],
  ],
  'weight' => $taxonomy['weight'],
  'parent' => [$parent],
])->save();

Comments

david4lim created an issue. See original summary.

david4lim’s picture

StatusFileSize
new571 bytes

Added a patch for solving the issue.

awm’s picture

Status: Active » Needs review
timkruijsen’s picture

it should include the UUID

Why should it include that? I'd personally rather not have it depend on something like that as it is completely independent of the content.

david4lim’s picture

Hi @timKruijsen, the UUID is the only valid id to identify a content across environments or sites, it should be part of the creation of the term to avoid false negatives finding existing terms. The issue I had was all the term references I had in nodes were deleted after running "drush it --choice=full", and everytime I run the command the terms are deleted and recreated, without the UUIDs there are no way to know the terms into the DB are the same as the ones into the config files.

  • david4lim authored 69bdc5d on 8.x-1.x
    Issue #3018283 by david4lim: UUID is not properly assigned to new terms
    
timkruijsen’s picture

Status: Needs review » Fixed
timkruijsen’s picture

Agreed, I've included it in the 1.15 release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.