Skip to content

Commit 2029240

Browse files
committed
save unset data as empty string. #658
Previous versions of the SQLite plugin (incorrectly) saved PHP null values as empty strings. The new version correctly saves them as database NULL. However for struct, we always want empty strings.
1 parent 039b05b commit 2029240

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

meta/AccessTablePage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function clearData()
3434
if ($col->isMulti()) {
3535
$data[$col->getLabel()] = array();
3636
} else {
37-
$data[$col->getLabel()] = null;
37+
$data[$col->getLabel()] = '';
3838
}
3939
}
4040

meta/ValueValidator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public function __construct()
3333
*/
3434
public function validateValue(Column $col, &$rawvalue)
3535
{
36+
if($rawvalue === null) $rawvalue = ''; // no data was passed
37+
3638
// fix multi value types
3739
$type = $col->getType();
3840
$trans = $type->getTranslatedLabel();

0 commit comments

Comments
 (0)