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);
Comment | File | Size | Author |
---|---|---|---|
#4 | node_clone-truncation-2838408-4.patch | 1.06 KB | azinck |
#2 | node_clone-truncation-2838408-2.patch | 1.09 KB | gustavderdrache |
Comments
Comment #2
gustavderdrache CreditAttribution: gustavderdrache commentedAttached is a patch that truncates the title manually to 255 characters, and warns the user when it occurs.
Comment #3
gustavderdrache CreditAttribution: gustavderdrache commentedComment #4
azinck CreditAttribution: azinck commentedUpdated 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.