I imported a couple of publications with long titles (longest: 355 characters), which are being truncated to 255 characters on import.

It would be great, if this could get changed to a larger field, to accommodate longer titles.

Here a few ramblings about it:
According to the returned warning message, titles get truncated because of the biblio_short_title database field declaration in the biblio table (varchar(255)). The title of the field implies that there might be also a biblio_long_title field (alas, there isn't). For the sake of simplicity, it would probably be better, to keep the title in only one field.

Drupal 7 requires a minimum MySQL installation of 5.0. Since MySQL 5.03, varchar fields can be longer than 255 char (65,535 character).

From the mysql 5.0 documentation (http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html):

Prior to MySQL 5.0.3, a VARCHAR column with a length specification greater than 255 is converted to the smallest TEXT type that can hold values of the given length. For example, VARCHAR(500) is converted to TEXT, and VARCHAR(200000) is converted to MEDIUMTEXT. However, this conversion affects trailing-space removal.

There is also an issue with indexing of text columns, but is seems like, a column declaration change to a longer length wouldn't break anything. However, I don't have a mysql installation prior to 5.03 to try this out, and I don't know anything about the other supported database types.

Comments

rjerome’s picture

The main title is actually stored in the "node" table, "title" column (which is varchar 255), not the biblio table. If it's complaining about "biblio_short_titles" being truncated, this may be a field mapping issue. I've seen this with EndNote XML files.

earwax’s picture

I ran into this problem as well with long titles, and it is indeed Drupal's default title field. Does this mean that there is no proper way to increase the title field to more than 255? We certainly don't want to modify the Drupal Core and its table structures.

Is this a "won't fix" issue?

rjerome’s picture

I think the only way around this is to create a new column in the biblio table called "long_title", save the title in there and then save a truncated version in the drupal core title field. On node load, we would overwrite the core title with the longer version.

earwax’s picture

This does sound like a good workaround.

andrewgearhart’s picture

I'm currently handling this with the Node Title Length module: https://www.drupal.org/project/title_length.
That said, our bibliography needs are currently requiring secondary_title and call_number to be increased to 500+ characters ... so I'm writing a patch to increase their length to text instead of varchar