Current implementation can create and save stubs with wrong bundle of real entity. And then due to code in Drupal\Core\Entity\ContentEntityBase::onChange() method entity behavior becomes broken.
This can be reproduced in next scenario:
2) We have two node types: article, news.
1) During deployment the menu link entity with link to non-existing news node is replicated first.
In this case the stub node is created and saved with 'article' bundle.
2) Then the real news node is replicated, the bundle is 'news' now. But after replication fields configured only for 'news' bundle are not replicated.
The solution is to create stubs with correct bundle.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | stubs-correct-bundle-2875181-test-only-4.patch | 6.11 KB | undertext |
| #4 | stubs-correct-bundle-2875181-4.patch | 7.66 KB | undertext |
| #3 | stubs-correct-bundle-2875181-test-only.patch | 6.12 KB | undertext |
| #2 | stubs-correct-bundle-2875181.patch | 7.67 KB | undertext |
Comments
Comment #2
undertext commentedComment #3
undertext commentedAnd this is test-only-patch
Comment #4
undertext commentedFixed namespace of test.
Comment #5
undertext commentedComment #8
jeqq commentedThank you @undertext!