Skip to content

Commit 0b2ab57

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2 parents a2ef278 + 9c3ce37 commit 0b2ab57

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

libraries/classes/InsertEdit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,7 @@ public function getQueryValuesForInsertAndUpdateInMultipleEdit(
16631663
. ' = ' . $currentValueAsAnArray;
16641664
} elseif (
16651665
! (empty($multiEditFuncs[$key])
1666+
&& empty($multiEditColumnsNull[$key])
16661667
&& isset($multiEditColumnsPrev[$key])
16671668
&& $currentValue === $multiEditColumnsPrev[$key])
16681669
&& $currentValueAsAnArray !== ''

psalm-baseline.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3283,9 +3283,7 @@
32833283
<code>$_POST['field_transformation'][$fieldindex]</code>
32843284
<code>$_POST['field_transformation_options'][$fieldindex]</code>
32853285
</MixedArrayAccess>
3286-
<MixedAssignment occurrences="3">
3287-
<code>$GLOBALS['num_fields']</code>
3288-
<code>$GLOBALS['result']</code>
3286+
<MixedAssignment occurrences="1">
32893287
<code>$mimetype</code>
32903288
</MixedAssignment>
32913289
</file>

test/classes/InsertEditTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,6 +2217,30 @@ public function testGetQueryValuesForInsertAndUpdateInMultipleEdit(): void
22172217
],
22182218
$result
22192219
);
2220+
2221+
// Test to see if a field can be set to NULL
2222+
$result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit(
2223+
$multi_edit_columns_name,
2224+
['on'],
2225+
'',
2226+
[''],
2227+
[],
2228+
false,
2229+
[],
2230+
[],
2231+
'NULL',
2232+
[],
2233+
'0',
2234+
[]
2235+
);
2236+
2237+
$this->assertEquals(
2238+
[
2239+
['`fld` = NULL'],
2240+
[],
2241+
],
2242+
$result
2243+
);
22202244
}
22212245

22222246
/**

0 commit comments

Comments
 (0)