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.
Problem/Motivation
Currently entity type schema is created only when installing the module providing the definitions. However it may happen that a new definition is added in an already installed module. Currently the related schema will never be created nor it will be detected as a missing schema update.
Proposed resolution
Make the EntityDefinitionUpdateManager
detect also new entity type definitions and apply the related updates.
Remaining tasks
- Validate the proposed solution
Write a patch- Review it
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#10 | entity-on_create-2423213-10-test.patch | 4.89 KB | plach |
#13 | entity-on_create-2423213-13.patch | 15.82 KB | plach |
Comments
Comment #1
plachLet's see how many things break.
Comment #2
plachA
diff -w
version to ease reviewing.Comment #3
plachComment #5
catchComment #6
plach@catch:
I'm not sure this affects the upgrade path: once this is fixed, we just need to apply the regular db updates, I think.
Comment #7
plachThis should fix test failures, additional test coverage still to do.
Comment #8
catch@plach doesn't this mean that:
1. Install a module
2. Module adds an entity type in a new release
3. Update that module
4. Site is hosed without manual intervention
If so I think the upgrade path tag is right, but feel free to untag if this isn't the case.
Comment #9
plachI meant the 4 can be fixed by just running update.php, if this is fixed when we already support the upgrade path.
Comment #10
plachAnd now with tests. Interdiff is the test-only patch.
Comment #12
BerdirWhy is this needed here?
I think we don't need the custom handler and fieldable/cache definitions, to keep this as short as possible?
Also, I think "New test entity" reads a bit better?
RTBC apart from those nitpicks I think.
Comment #13
plachBecause also config entities trigger the on create event, and for some reason those are not registered in the entity manager state when setting up the test.
Comment #14
BerdirGreat, this looks good to me then.
Comment #15
alexpottThis issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 8007ab1 and pushed to 8.0.x. Thanks!
Comment #17
plachThanks!
Comment #19
xjm