Index: pathauto.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.admin.inc,v retrieving revision 1.10.2.1 diff -u -p -r1.10.2.1 pathauto.admin.inc --- pathauto.admin.inc 24 Jun 2008 16:07:51 -0000 1.10.2.1 +++ pathauto.admin.inc 9 Jan 2010 21:16:22 -0000 @@ -70,7 +70,7 @@ function pathauto_admin_settings() { '#size' => 3, '#maxlength' => 3, '#default_value' => variable_get('pathauto_max_length', 100), - '#description' => t('Maximum length of aliases to generate. 100 is recommended. See Pathauto help for details.', array('@pathauto-help' => url('admin/help/pathauto'))), + '#description' => t('Maximum length of aliases to generate. 100 is recommended. The maximum possible length is @max. See Pathauto help for details.', array('@pathauto-help' => url('admin/help/pathauto'), '@max' => _pathauto_get_schema_alias_maxlength())), ); $form['general']['pathauto_max_component_length'] = array( Index: pathauto.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v retrieving revision 1.45.2.6 diff -u -p -r1.45.2.6 pathauto.inc --- pathauto.inc 3 Dec 2009 16:13:01 -0000 1.45.2.6 +++ pathauto.inc 9 Jan 2010 21:16:22 -0000 @@ -301,7 +301,7 @@ function pathauto_create_alias($module, // Trim any leading or trailing slashes $alias = preg_replace('/^\/|\/+$/', '', $alias); - $maxlength = min(variable_get('pathauto_max_length', 100), 128); + $maxlength = min(variable_get('pathauto_max_length', 100), _pathauto_get_schema_alias_maxlength()); $alias = drupal_substr($alias, 0, $maxlength); // If the alias already exists, generate a new, hopefully unique, variant @@ -349,6 +349,17 @@ function pathauto_create_alias($module, } /** + * Fetch the maximum length of the {url_alias}.dst field from the schema. + * + * @return + * An integer of the maximum url alias length allowed by the database. + */ +function _pathauto_get_schema_alias_maxlength() { + $schema = drupal_get_schema('url_alias'); + return $schema['fields']['dst']['length']; +} + +/** * Verify if the given path is a valid menu callback. * * Taken from menu_execute_active_handler().