Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::validateOptionsForm().
Overrides DisplayPluginBase::validateOptionsForm
public function validateOptionsForm(&$form, &$form_state) {
parent::validateOptionsForm($form, $form_state);
if ($form_state['section'] == 'path') {
if (strpos($form_state['values']['path'], '%') === 0) {
form_error($form['path'], t('"%" may not be used for the first segment of a path.'));
}
// Automatically remove '/' and trailing whitespace from path.
$form_state['values']['path'] = trim($form_state['values']['path'], '/ ');
}
}