- Issue created by @plopesc
- Merge request !2Issue #3420340: Check if entity isNew() instead of the existence of the id()... → (Open) created by plopesc
- Status changed to Needs review
10 months ago 9:21am 9 February 2024
_revision_log_default_get_original()
checks if the entity has an id() to try to retrieve latest revision.
There are situation where the entity is new and might not have older revisions, like when migrating them, preserving IDs.
Would be more accurate to rely on isNew() method instead of the existence of the id value.
Create moderated entities via migrate, preserving the ids in the original system as the original new IDs
Migration will throw PHP warning for every migrated entity:
[warning] array_flip(): Can only flip string and integer values, entry skipped ContentEntityStorageBase.php:667
Check $entity->isNew()
instead if $entity->id()
in _revision_log_default_get_original()
Needs review
1.0
Code