Use ISSET - Not all forms have a field called "Title"
NancyDru - November 14, 2007 - 01:51
| Project: | Longer Node Titles |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | NancyDru |
| Status: | closed |
Jump to:
Description
Not all forms have a field called "Title". You should do something like this:
if (isset($form['title'])) {
$form['title']['#maxlength'] = 255;
}
#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
#8
Fix committed
#9
Automatically closed -- issue fixed for two weeks with no activity.