public function CoreViewsExposedFilter::submitConfigurationForm in Core Views Facets 8
Form submission handler.
Parameters
array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().
Overrides FacetSourcePluginBase::submitConfigurationForm
File
- src/
Plugin/ facets/ facet_source/ CoreViewsExposedFilter.php, line 204
Class
- CoreViewsExposedFilter
- Represents a facet source of the core views with exposed filters.
Namespace
Drupal\core_views_facets\Plugin\facets\facet_sourceCode
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::submitConfigurationForm($form, $form_state);
$facet_source_id = $this->facet
->getFacetSourceId();
$views_filters = $this
->getFields();
$field_identifier = $form_state
->getValue('facet_source_configs')[$facet_source_id]['field_identifier'];
if (empty($field_identifier) || empty($views_filters[$field_identifier])) {
return;
}
$this->facet
->setFieldIdentifier($field_identifier);
}