I’m working on a project that is giving me some hardcore Drupal experience, and in general I’m liking Drupal quite a bit (more on this when the project is finished though).
Anyways, even though I’m working with Drupal 6, there seems to be some legacy code from older versions in place - among them the 128 character limit (which was imposed to support old version of MySQL). While the node database schema has been updated to a default of 255 characters for node titles, the poll schema appears to impose this old restriction to some degree.
The Solution
Fortunately, the solution is simple. Open up poll.module, look for the function called poll_form(), and add ‘#maxlength’ => 255 to the $form[’title’] array:
$form['title'] = array( '#type' => 'textfield', '#title' => check_plain($type->title_label), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5, '#maxlength' => 255, );
Reload your modules by simply visiting the modules page in the admin area, and you can now have poll questions up to 255 characters.
Leave a comment