Merge pull request #17686 from kamil-tekiela/Allow-fields-to-be-set-to-null
Allow fields to be set to NULL
This commit is contained in:
commit
9c3ce37491
@ -1673,6 +1673,7 @@ class InsertEdit
|
||||
. ' = ' . $currentValueAsAnArray;
|
||||
} elseif (
|
||||
! (empty($multiEditFuncs[$key])
|
||||
&& empty($multiEditColumnsNull[$key])
|
||||
&& isset($multiEditColumnsPrev[$key])
|
||||
&& $currentValue === $multiEditColumnsPrev[$key])
|
||||
&& $currentValueAsAnArray !== ''
|
||||
|
||||
@ -2143,6 +2143,30 @@ class InsertEditTest extends AbstractTestCase
|
||||
],
|
||||
$result
|
||||
);
|
||||
|
||||
// Test to see if a field can be set to NULL
|
||||
$result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit(
|
||||
$multi_edit_columns_name,
|
||||
['on'],
|
||||
'',
|
||||
[''],
|
||||
[],
|
||||
false,
|
||||
[],
|
||||
[],
|
||||
'NULL',
|
||||
[],
|
||||
'0',
|
||||
[]
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
['`fld` = NULL'],
|
||||
[],
|
||||
],
|
||||
$result
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user