public function Role::validateOptionsForm in Views (for Drupal 7) 8.3
Provide the default form form for validating options
Overrides AccessPluginBase::validateOptionsForm
File
- lib/
Views/ user/ Plugin/ views/ access/ Role.php, line 74 - Definition of Views\user\Plugin\views\access\Role.
Class
- Role
- Access plugin that provides role-based access control.
Namespace
Views\user\Plugin\views\accessCode
public function validateOptionsForm(&$form, &$form_state) {
if (!array_filter($form_state['values']['access_options']['role'])) {
form_error($form['role'], t('You must select at least one role if type is "by role"'));
}
}