You are here

function views_element_validate_tags in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 8.3 views.module \views_element_validate_tags()

Validation callback for query tags.

1 string reference to 'views_element_validate_tags'
views_plugin_query_default::options_form in plugins/views_plugin_query_default.inc
Add settings for the ui.

File

plugins/views_plugin_query_default.inc, line 1726
Definition of views_plugin_query_default.

Code

function views_element_validate_tags($element, &$form_state) {
  $values = array_map('trim', explode(',', $element['#value']));
  foreach ($values as $value) {
    if (preg_match("/[^a-z_]/", $value)) {
      form_error($element, t('The query tags may only contain lower-case alphabetical characters and underscores.'));
      return;
    }
  }
}