Skip to content
Snippets Groups Projects
Commit cdb43aa4 authored by dakwamine's avatar dakwamine Committed by Kalle Kipinä
Browse files

Issue #3037390 by Dakwamine, kekkis, JvE: Unable to index item when html...

Issue #3037390 by Dakwamine, kekkis, JvE: Unable to index item when html filter processor is enabled on search api index
parent f4f57ec8
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
namespace Drupal\search_api_mapping\Plugin\search_api\processor;
use Drupal\search_api\Datasource\DatasourceInterface;
use Drupal\search_api\Item\FieldInterface;
use Drupal\search_api\Item\ItemInterface;
use Drupal\search_api_mapping\Plugin\search_api\processor\Property\MappedFieldProperty;
use Drupal\search_api\Processor\ProcessorPluginBase;
......@@ -102,10 +103,25 @@ class MappedField extends ProcessorPluginBase {
}
if (!empty($values)) {
$mapped_field->addValue($values);
$this->addValuesToMappedField($mapped_field, $values);
continue;
}
$mapped_field->addValue($field_values);
$this->addValuesToMappedField($mapped_field, $field_values);
}
}
/**
* Adds values contained in an array to the mapped field.
*
* @param \Drupal\search_api\Item\FieldInterface $mapped_field
* Mapped field.
* @param array $values
* Values to insert.
*/
private function addValuesToMappedField(FieldInterface $mapped_field, array $values) {
foreach ($values as $value) {
$mapped_field->addValue($value);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment