You are here

function pathauto_admin_settings_validate in Pathauto 5.2

Same name and namespace in other branches
  1. 6 pathauto.admin.inc \pathauto_admin_settings_validate()

Validate pathauto_admin_settings form submissions.

File

./pathauto.module, line 766
Main file for the Pathauto module, which automatically generates aliases for content.

Code

function pathauto_admin_settings_validate($form_id, $form_values) {

  // Validate that the separator is not set to be removed per http://drupal.org/node/184119
  // This isn't really all that bad so warn, but still allow them to save the value.
  $separator = $form_values['pathauto_separator'];
  $punctuation = pathauto_punctuation_chars();
  foreach ($punctuation as $name => $details) {
    if ($details['value'] == $separator) {
      $action = $form_values['pathauto_punctuation_' . $name];
      if ($action == 0) {
        drupal_set_message(t('You have configured the @name to be the separator and to be removed when encountered in strings. This can cause problems with your patterns and especially with the catpath and termpath patterns. You should probably set the action for @name to be "replace by separator"', array(
          '@name' => $details['name'],
        )), 'error');
      }
    }
  }
}