Skip to content

Commit

Permalink
Merge pull request #326 from demeritcowboy/timestamp-update-null
Browse files Browse the repository at this point in the history
Also check timestamp types for update() when trying to update a timestamp field with a blank value
  • Loading branch information
seamuslee001 authored Jul 18, 2021
2 parents 0a3e848 + 92529aa commit 6998b96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DB/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ function update($dataObject = false)
// DATE is empty... on a col. that can be null..
// note: this may be usefull for time as well..
if (!$this->$k &&
(($v & DB_DATAOBJECT_DATE) || ($v & DB_DATAOBJECT_TIME)) &&
(($v & DB_DATAOBJECT_DATE) || ($v & DB_DATAOBJECT_TIME) || ($v & DB_DATAOBJECT_MYSQLTIMESTAMP)) &&
!($v & DB_DATAOBJECT_NOTNULL)) {

$settings .= "$kSql = NULL ";
Expand Down

0 comments on commit 6998b96

Please sign in to comment.