The correct install code should be:

function longer_titles_install() {      
  $result = db_query("ALTER TABLE {node} CHANGE 'title' VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
  $result = db_query("ALTER TABLE {node_revisions} CHANGE 'title' VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");

The column name needed to be in quotes. And table names are supposed to be in curly brackets.

Note: you need to change the "node_revisions" table as well.

Comments

nancydru’s picture

Assigned: Unassigned » nancydru
Status: Active » Fixed

Fix committed.

dwoods’s picture

Version: 5.x-1.x-dev » 5.x-1.0
Status: Fixed » Active

Hi,

It still fails for me. I think the install should be:

function longer_titles_install() {     
  $result = db_query("ALTER TABLE {node} CHANGE 'title' 'title' VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
  $result = db_query("ALTER TABLE {node_revisions} CHANGE 'title' 'title' VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
nancydru’s picture

Status: Active » Fixed

Actually it appears that the quotes should not be there. I removed them and the character set (in case you want something else). It now works correctly for me. The fix has been committed - it will take a few hours to roll up.

function longer_titles_install() {       
  $result = db_query("ALTER TABLE {node} CHANGE title title VARCHAR(255) NOT NULL;");
  $result = db_query("ALTER TABLE {node_revisions} CHANGE title title VARCHAR(255) NOT NULL;");
}
Anonymous’s picture

Status: Fixed » Closed (fixed)

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