Skip to content

Commit

Permalink
Merge branch 'hotfix-10.8.18' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicWatson committed Jul 5, 2017
2 parents e7bc1b3 + 4d49c50 commit 0837f93
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions system/services/presideObjects/VersioningService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,27 @@ component {
changedFields.append( field );
}
} else {

if ( !StructKeyExists( oldData, field ) ) {
continue;
}

var propDbType = ( properties[ field ].dbtype ?: "" );
if ( IsEmpty( arguments.newData[ field ] ?: "" ) ) {
if ( propDbType == "boolean" ) {
arguments.newData[ field ] = 0;
}

if ( propDbType == "boolean" && IsEmpty( arguments.newData[ field ] ?: "" ) ) {
arguments.newData[ field ] = 0;
}
if ( StructKeyExists( oldData, field ) && Compare( oldData[ field ], arguments.newData[ field ] ?: "" ) ) {

if ( ( propDbType == "datetime" || propDbType == "date" ) && isDate( arguments.newData[ field ] ?: "" ) ) {
if ( dateCompare( oldData[ field ], arguments.newData[ field ] ) ) {
changedFields.append( field );
}

} else if ( Compare( oldData[ field ], arguments.newData[ field ] ?: "" ) ) {
changedFields.append( field );
}
}

}

return changedFields;
Expand Down

0 comments on commit 0837f93

Please sign in to comment.