- Issue created by @drunken monkey
- Merge request !261Resolve #3541714: "Fix Index::setProcessors() to not assume $processors is keyed by plugin ID" → (Open) created by drunken monkey
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
🐛
Fix contract of IndexInterface::setDatasources()
Active
. 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.)
Active
1.0
General code