function views_element_validate_tags
Same name in other branches
- 9 core/modules/views/views.module \views_element_validate_tags()
- 10 core/modules/views/views.module \views_element_validate_tags()
- 11.x core/modules/views/views.module \views_element_validate_tags()
Validation callback for query tags.
1 string reference to 'views_element_validate_tags'
- Sql::buildOptionsForm in core/
modules/ views/ src/ Plugin/ views/ query/ Sql.php - Add settings for the ui.
File
-
core/
modules/ views/ views.module, line 813
Code
function views_element_validate_tags($element, FormStateInterface $form_state) {
$values = array_map('trim', explode(',', $element['#value']));
foreach ($values as $value) {
if (preg_match("/[^a-z_]/", $value)) {
$form_state->setError($element, t('The query tags may only contain lower-case alphabetical characters and underscores.'));
return;
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.