add some validation to row edit, better handle setting null cols with empty
This commit is contained in:
@@ -325,8 +325,12 @@ class Changeset
|
||||
foreach ($newVals as $colId => $value) {
|
||||
if (starts_with($colId, '_')) continue; // internals
|
||||
|
||||
if (!isset($origRow->$colId) || $value != $origRow->$colId) {
|
||||
$updateObj[$colId] = $cols[$colId]->cast($value);
|
||||
$col = $cols[$colId];
|
||||
$value = $col->cast($value);
|
||||
$origValue = $col->cast(isset($origRow->$colId) ? $origRow->$colId : null);
|
||||
|
||||
if ($value !== $origValue) {
|
||||
$updateObj[$colId] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user