Issue #543: set $expression->lastUpdateDate #544
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The real changes besides white space include:
$expression->productionUseInd
to a string in theelse
clause$expression->productionUseInd
immediately after theelse
clause (if it is an update and the value is already set, it would have been always overwritten)$expression->lastUpdateDate = date('Y-m-d H:i:s');
so that we don't get the cannot be null errorIssue #543
TEST PLAN
Environment (I believe the problem lies in the MySQL configuration):
explicit_defaults_for_timestamp
set toTRUE
Confirmation of Problem
Without the patch, when trying to add an Expression to a License in the Licensing module, the error There was a problem with the database: Column 'lastUpdateDate' cannot be null is shown and the Expression cannot be saved.
Resolution
With the patch, the
lastUpdateDate
value is explicitly set so that theDatabaseObject
code is not finding no value and trying to set the field toNULL
. The Expression should save without any problems.