diff --git a/src/Form/FacetDisplayForm.php b/src/Form/FacetDisplayForm.php index 1c4d701..5a5a04b 100644 --- a/src/Form/FacetDisplayForm.php +++ b/src/Form/FacetDisplayForm.php @@ -224,7 +224,7 @@ class FacetDisplayForm extends EntityForm { $form['facet_settings'][$processor_id]['status'] = array( '#type' => 'checkbox', '#title' => (string) $processor->getPluginDefinition()['label'], - '#default_value' => $processor->isLocked() || !empty($processor->configuration['enabled']), + '#default_value' => $processor->isLocked() || !empty($enabled_processors[$processor_id]), '#description' => $processor->getDescription(), '#attributes' => array( 'class' => array( diff --git a/src/Tests/IntegrationTest.php b/src/Tests/IntegrationTest.php index 17cfb38..bcb12d2 100644 --- a/src/Tests/IntegrationTest.php +++ b/src/Tests/IntegrationTest.php @@ -385,6 +385,25 @@ class IntegrationTest extends FacetWebTestBase { } /** + * Tests for processor integration. + */ + public function testProcessorIntegration() { + $facet_name = "Snowy owl~"; + $facet_id = "snowy_owl_"; + $this->addFacet($facet_name); + + // Go to the processors form and check that the count limit processor is not + // checked. + $this->drupalGet('admin/config/search/facets/' . $facet_id . '/display'); + $this->assertNoFieldChecked('edit-facet-settings-count-limit-status'); + + $form = ['facet_settings[count_limit][status]' => TRUE]; + $this->drupalPostForm(NULL, $form, $this->t('Save')); + $this->assertResponse(200); + $this->assertFieldChecked('edit-facet-settings-count-limit-status'); + } + + /** * Deletes a facet block by id. * * @param string $id