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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | gathercontent-fatal-error-translatable-node-3044902-2.patch | 497 bytes | scott_euser |
Comments
Comment #2
scott_euser commentedComment #4
Kova101 commentedHello scott_euser,
Thank you for the patch!
I've committed the changes.
Comment #5
scott_euser commentedThanks!