diff --git a/src/Form/IndexProcessorsForm.php b/src/Form/IndexProcessorsForm.php index 8a51ffc..f5b26ed 100644 --- a/src/Form/IndexProcessorsForm.php +++ b/src/Form/IndexProcessorsForm.php @@ -250,6 +250,12 @@ class IndexProcessorsForm extends EntityForm { $values = $form_state->getValues(); $new_settings = array(); + $old_processors = $this->entity->getProcessors(); + $old_configurations = array(); + foreach ($old_processors as $id => $processor) { + $old_configurations[$id] = $processor->getConfiguration(); + } + // Store processor settings. /** @var \Drupal\search_api\Processor\ProcessorInterface $processor */ $processors = $this->entity->getProcessors(FALSE); @@ -272,8 +278,7 @@ class IndexProcessorsForm extends EntityForm { } } - $old_processors = $this->entity->getProcessors(); - + $new_configurations = array(); foreach ($new_settings as $plugin_id => $new_processor_settings) { /** @var \Drupal\search_api\Processor\ProcessorInterface $new_processor */ $new_processor = $this->processorPluginManager->createInstance($plugin_id, $new_processor_settings['settings']); @@ -281,11 +286,10 @@ class IndexProcessorsForm extends EntityForm { $this->entity->removeProcessor($plugin_id); } $this->entity->addProcessor($new_processor); + $new_configurations[$plugin_id] = $new_processor->getConfiguration(); } - $new_processors = $this->entity->getProcessors(); - - if ($old_processors != $new_processors) { + if ($old_configurations != $new_configurations) { $form_state->set('processors_changed', TRUE); } }