Given a node whose title is at or near 255 characters in length, the prefix "Clone of " will yield a string that exceeds the VARCHAR(255) limit, resulting in an error message like this:

PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'title' at row 1: INSERT INTO {node} (vid, type, language, title, uid, status, created, changed, comment, promote, sticky, tnid, translate, rh_action, rh_redirect, rh_redirect_response) 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, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15);

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gustavderdrache created an issue. See original summary.

gustavderdrache’s picture

Attached is a patch that truncates the title manually to 255 characters, and warns the user when it occurs.

gustavderdrache’s picture

Status: Active » Needs review
azinck’s picture

Updated the message to make it a bit easier to read. With both the old and the new titles in the same warning message it was hard to see what was going on.