Commit e7c0975c authored by catch's avatar catch
Browse files

Issue #1866830 by dawehner: Simplify DisplayPluginBase::validateOptionsForm().

parent f5f88298
......@@ -2076,44 +2076,21 @@ public function validateOptionsForm(&$form, &$form_state) {
}
}
break;
case 'style_options':
$style = TRUE;
case 'row_options':
// if row, $style will be empty.
$plugin = $this->getPlugin(empty($style) ? 'row' : 'style');
if ($plugin) {
$plugin->validateOptionsForm($form[$form_state['section']], $form_state);
}
break;
case 'access_options':
$plugin = $this->getPlugin('access');
if ($plugin) {
$plugin->validateOptionsForm($form['access_options'], $form_state);
}
break;
case 'query':
if ($this->view->query) {
$this->view->query->validateOptionsForm($form['query'], $form_state);
}
break;
case 'cache_options':
$plugin = $this->getPlugin('cache');
if ($plugin) {
$plugin->validateOptionsForm($form['cache_options'], $form_state);
}
break;
case 'exposed_form_options':
$plugin = $this->getPlugin('exposed_form');
if ($plugin) {
$plugin->validateOptionsForm($form['exposed_form_options'], $form_state);
}
break;
case 'pager_options':
$plugin = $this->getPlugin('pager');
if ($plugin) {
$plugin->validateOptionsForm($form['pager_options'], $form_state);
}
break;
}
// Validate plugin options. Every section with "_options" in it, belongs to
// a plugin type, like "style_options".
if (strpos($form_state['section'], '_options') !== FALSE) {
$plugin_type = str_replace('_options', '', $form_state['section']);
// Load the plugin and let it handle the validation.
if ($plugin = $this->getPlugin($plugin_type)) {
$plugin->validateOptionsForm($form[$form_state['section']], $form_state);
}
}
foreach ($this->extender as $extender) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment