diff --git a/src/Entity/Facet.php b/src/Entity/Facet.php index ab04f0f..b29842c 100644 --- a/src/Entity/Facet.php +++ b/src/Entity/Facet.php @@ -329,7 +329,16 @@ class Facet extends ConfigEntityBase implements FacetInterface { } return $this->processors; - } /** + } + + /** + * {@inheritdoc} + */ + public function getProcessorConfigs() { + return $this->processor_configs; + } + + /** * {@inheritdoc} */ public function getQueryType() { diff --git a/src/FacetInterface.php b/src/FacetInterface.php index 1d86289..1406476 100644 --- a/src/FacetInterface.php +++ b/src/FacetInterface.php @@ -293,6 +293,14 @@ interface FacetInterface extends ConfigEntityInterface { public function getProcessorsByStage($stage, $only_enabled = TRUE); /** + * Retrieves this facets's processor configs. + * + * @return array + * An array of processors and their configs. + */ + public function getProcessorConfigs(); + + /** * Sets the "only visible when facet source is visible" boolean flag. * * @param bool $only_visible_when_facet_source_is_visible diff --git a/src/Form/FacetDisplayForm.php b/src/Form/FacetDisplayForm.php index 1c4d701..e3632fe 100644 --- a/src/Form/FacetDisplayForm.php +++ b/src/Form/FacetDisplayForm.php @@ -393,6 +393,8 @@ class FacetDisplayForm extends EntityForm { ); } + $processor_settings = $facet->getProcessorConfigs(); + // Fill in the containers previously created with the processors that are // enabled on the facet. foreach ($processors_by_stage as $stage => $processors) { @@ -498,9 +500,8 @@ class FacetDisplayForm extends EntityForm { 'weights' => array(), 'settings' => array(), ); - $processor_values = $values[$form_container_key][$processor_id]; - if (!empty($processor_values['weights'])) { - $new_settings['weights'] = $processor_values['weights']; + if (!empty($values['processors'][$processor_id]['weights'])) { + $new_settings['weights'] = $values['processors'][$processor_id]['weights']; } if (isset($form[$form_container_key][$processor_id]['settings'])) { $processor_form_state = new SubFormState(