Problem/Motivation

When the node is translatable, if the node does not yet exist, a fatal error occurs:
The website encountered an unexpected error. Please try again later.Drupal\Core\Entity\EntityStorageException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'status' at row 1: INSERT INTO {gathercontent_operation_item} (uuid, operation_uuid, item_status, item_status_color, item_name, template_name, status, gc_id, nid, created, changed) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10);...

This happens because the 'title' is left blank if the node is translatable:

    if (!$is_translatable && empty($entity->getTitle())) {
      $entity->setTitle($gc_item->name);
    }

in gathercontent/src/Import/ContentProcess/ContentProcessor.php

Proposed resolution

Set title if empty on translatable node types as well.

Remaining tasks

Patch coming shortly.

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Fix fatal error on creation of new content into translatable node types.

Comments

scott_euser created an issue. See original summary.

scott_euser’s picture

Assigned: scott_euser » Unassigned
Status: Active » Needs review
StatusFileSize
new497 bytes

  • Kova101 committed 2411b01 on 8.x-4.x authored by scott_euser
    Issue #3044902 by scott_euser: Fatal error on new node creation for...
Kova101’s picture

Assigned: Unassigned » Kova101
Status: Needs review » Fixed

Hello scott_euser,

Thank you for the patch!
I've committed the changes.

scott_euser’s picture

Thanks!

Status: Fixed » Closed (fixed)

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