mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-22 08:36:10 +01:00
BUGFIX: Also remove fields containing "null"
This commit is contained in:
parent
0159315183
commit
379dddf8ac
2 changed files with 12 additions and 1 deletions
|
@ -34,7 +34,7 @@ class RemoveProcessor implements ProcessorInterface
|
|||
}
|
||||
|
||||
foreach (GeneralUtility::trimExplode(',', $configuration['fields'], true) as $field) {
|
||||
if (isset($record[$field])) {
|
||||
if (array_key_exists($field, $record)) {
|
||||
unset($record[$field]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,6 +117,17 @@ class RemoveProcessorTest extends AbstractUnitTestCase
|
|||
'field 1' => 'Some content like lorem',
|
||||
],
|
||||
],
|
||||
'Fields with "null" san be removed' => [
|
||||
'record' => [
|
||||
'field 1' => null,
|
||||
],
|
||||
'configuration' => [
|
||||
'fields' => 'field 1',
|
||||
'_typoScriptNodeValue' => 'Codappix\SearchCore\DataProcessing\RemoveProcessor',
|
||||
],
|
||||
'expectedRecord' => [
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue