Download & Extend

Use ISSET - Not all forms have a field called "Title"

Project:Longer Node Titles
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:NancyDru
Status:closed (fixed)

Issue Summary

Not all forms have a field called "Title". You should do something like this:

  if (isset($form['title'])) {
    $form['title']['#maxlength'] = 255;
  }

Comments

#1

thanx. will update together with http://drupal.org/node/191815

#2

Hi:

I tried this out but the installer fails when trying to update the table for the new column width. Not sure what DB your "ALTER TABLE" command is for but it fails with MySQL. A test for DB type would be a good idea, then for the MySQL case use something like

ALTER TABLE node MODIFY COLUMN title VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

I ended up manually updating the table and all was well.

#3

sorry, have no time to properly configure and update this. could anyone post a valid patch, please.

#4

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.

#5

Dear Nancy,

I am so busy currently and because unexperienced also having troubles with properly using my CVS account. So if you could please update this module - I already have granted CVS account to you. Don't bother if you can't. Thanks!

#6

Okay. I'll try not to mess it up myself.

#7

Title:Use ISSET » Use ISSET - Not all forms have a field called "Title"

#8

Assigned to:Anonymous» NancyDru
Status:active» fixed

Fix committed

#9

Status:fixed» closed (fixed)

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

nobody click here