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

8.0.x
catch 2013-01-07 11:15:41 +00:00
parent f5f88298a5
commit e7c0975c57
1 changed files with 10 additions and 33 deletions

View File

@ -2076,44 +2076,21 @@ abstract class DisplayPluginBase extends PluginBase {
}
}
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) {