Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment #N
Problem/Motivation
When checking the UUID matching of the existing and original entity during an update, ConfigEntityBase mistakenly loads itself instead of the original entity.
Proposed resolution
Don't do that
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#17 | interdiff.txt | 3.44 KB | tim.plunkett |
#17 | configentity-2226027-16.patch | 40.13 KB | tim.plunkett |
Comments
Comment #1
sunCreated #2226037: Change signature of Entity::loadUnchanged() to accept an EntityInterface instead of random ID
Comment #2
tim.plunkettI'm merging #2220451: Expand coverage of config entity renames into this.
Comment #5
tim.plunkettYay more bugs (with fixes and test coverage)!
Comment #7
tim.plunkettOne more!
Comment #9
tim.plunkettUgh, breakpoint is the worst/weirdest.
Comment #11
tim.plunkett9: configentity-2226027-9.patch queued for re-testing.
Comment #12
tim.plunkettReroll after The Great Storage Rename
Comment #14
tim.plunkettHeh, even git can't help me with a silly mistake like this :)
Comment #15
dawehnerDoes it make sense to have an original ID on entity inserts?
I really like this
MOAAAAAAAAH!
Comment #16
tim.plunkett#15.1, the reason this is needed is if you tried to do this:
$entity = entity_create('foo);
$entity->save();
$entity->save();
Without that, the second save doesn't know what the original ID is, but knows that it's not new, and breaks.
So yes, I think it's fine to update the original ID on an insert.
Comment #17
tim.plunkettAdded some comments for the actual changes.
Comment #18
sunExcellent.
Comment #19
dawehnerThank you so much to improve the documentation here!
Comment #20
catchCommitted/pushed to 8.x, thanks!
Comment #22
tim.plunkettThanks!