PropertyModifierArrayToRow: fix on_empty

This commit is contained in:
Thomas Gelf 2020-10-09 11:47:31 +02:00
parent b961f16dfd
commit 2de46b819c
1 changed files with 3 additions and 4 deletions

View File

@ -42,13 +42,12 @@ class PropertyModifierArrayToRow extends PropertyModifierHook
public function transform($value)
{
if (empty($value)) {
$onDuplicate = $this->getSetting('on_duplicate', 'reject');
$onDuplicate = $this->getSetting('on_empty', 'reject');
switch ($onDuplicate) {
case 'reject':
$this->rejectRow();
return null;
return [];
case 'keep':
return null;
return [null];
case 'fail':
throw new InvalidArgumentException('Failed to clone row, value is empty');
default: