The $processors argument of \Drupal\search_api\IndexInterface::setProcessors() is documented as follows:
/**
* @param \Drupal\search_api\Processor\ProcessorInterface[] $processors
* An array of processors.
*/
Specifically, we do not require it to be keyed by plugin ID. However, Index::setProcessors() looks like this:
public function setProcessors(array $processors) {
$this->processorInstances = $processors;
return $this;
}
Since the rest of the code assumes $this->processorInstances is keyed by plugin ID, this relies on the undocumented assumption that $processors will always be keyed by plugin ID.
We actually fixed the same thing for setDatasources() back in #3483584: Fix Index::setDatasources() to match its contract. However, seems we forgot to check whether other setters are also affected. (setFields() also assumes that $fields is keyed correctly, but there it is actually specified in the contract so it should be fine.)
Issue fork search_api-3541714
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
drunken monkeyShould be fixed in this MR.
Comment #4
drunken monkeyMerged.
Comment #6
mansidrupalbliss commentedThank you Thomas for fixing this issue.