Errors when a reference field is blank

Created on 2 July 2024, 5 months ago

Problem/Motivation

When I import a CSV file with Taxonomy Reference fields that are blank I get the following error.

Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null: INSERT INTO "taxonomy_term_field_data" ("tid", "revision_id", "vid", "langcode", "status", "name", "description__value", "description__format", "weight", "changed", "default_langcode", "revision_translation_affected")

The module does not seem to handle empty fields well in this regard.

Steps to reproduce

Perform an import with a CSV file that has a column for a taxonomy reference field that both has and doesn't have values in it.

Proposed resolution

Add empty/null checking for reference fields.

πŸ› Bug report
Status

Active

Version

10.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ekapus

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024