Fix false positive changes for generated columns by ignoring non-updatable/insertable columns#12385
Open
podoko wants to merge 3 commits intodoctrine:3.6.xfrom
Open
Fix false positive changes for generated columns by ignoring non-updatable/insertable columns#12385podoko wants to merge 3 commits intodoctrine:3.6.xfrom
podoko wants to merge 3 commits intodoctrine:3.6.xfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is an alternative / complementary fix to #12384
This PR avoids the problem by making
UnitOfWork::computeChangeSetandUnitOfWork::recomputeSingleEntityChangeSetskip fields that are not insertable/updatable when building the$actualData(for updates) and$changeSet(for insertions)This approach can be used instead of #12384 since it fixes the bug as well, but it also prevents the entity from being considered dirty if a user tried to edit the value of a column that is not updatable. (eg:
$entity->nonUpdatableField = 'new value';).As showcased in GH12017ChangeSetTest.php, the
changeSetpassed in the lifecycle events will also not include these properties since they are not considered for update. The same goes for non-insertable fields. Depending on your sensibility, this could be considered a breaking change, that's why I didn't include it in my previous PR. Though, it is better at addressing the following points of the initial issue:Fixes #12017