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.
A fieldable entity type without a bundle breaks Field UI integration for all bundles of entity types that alphabetically follow it.
Lazy bit of coding on my part.
Found by agentrickard because domain has no bundle.
It doesn't occur in core because User is the only entity type that doesn't have a bundle, and there are no fieldable entity types that come after U.
The $defaults array is never reset, so it is wrong populated into the routes that follow, breaking their placeholder expansion.
I'll write tests tonight.
Comment | File | Size | Author |
---|---|---|---|
#14 | field-ui-1986888-14-FAIL.patch | 3.55 KB | tim.plunkett |
#14 | field-ui-1986888-14-PASS.patch | 4.28 KB | tim.plunkett |
#11 | field-ui-1986888-11.patch | 5.81 KB | tim.plunkett |
#8 | field-ui-1986888-8.patch | 5.08 KB | tim.plunkett |
#7 | field-ui-1986888-7-FAIL.patch | 4.88 KB | tim.plunkett |
Comments
Comment #1
agentrickardConfirmed, and the patch fixes it. Lets see if I can write that test.
Comment #2
yched CreditAttribution: yched commentedDifferent bug, but was mentioned in the same IRC discussion : #1986902: Menu Rebuilding to late causing RouteNotFoundException during install
Comment #3
agentrickardWell, here's a start, but it looks like the entity system silently dies if we don't add all the new crufty ho-hah to really define the fake entity type.
Comment #4
tim.plunkettWhew. That's a lot of overhead.
Possibly the largest test-to-bugfix ratio I've ever done? 222:1
Since this means any module A-M that provides an entity type with no bundles, calling this major.
Comment #5
tim.plunkettThis is going to be much smaller after #1982088: Remove hook_entity_bundle_info()'s need for 'real path'. I'll post a reroll when that's in.
Comment #6
tim.plunkettDon't need the .install or .module anymore.
Comment #7
tim.plunkettThis fails locally for me...
Comment #8
tim.plunkettWell, I get this locally.
Fatal error: Allowed memory size of 6442450944 bytes exhausted (tried to allocate 76 bytes) in /Users/tim/www/d8/core/lib/Drupal/Core/Routing/RouteProvider.php on line 122
That's a fair amount of RAM. 6GB. More than the bots. So.
Here is the same test but also with node, since that's how we reproduced it originally. This should fail.
Comment #10
agentrickardI was having the same issue before applying that patch -- running out of memory during the routing phase.
Comment #11
tim.plunkettWell ideally #7 would have failed the same, but this is just as well. Here's #8 (test) + OP (fix).
Comment #12
yched CreditAttribution: yched commentedJust wondering what the 'aaa' and 'bbb' in entity type names and route_base_path are there for ?
Also wondering whether it would make more sense to reuse the test entity types defined by entity_test.module - by default they have no bundles, and have an API to create bundles.
Comment #13
tim.plunkettI was using the aaa and bbb because the bug is based on alphabetical order. But yeah, I think I will just reuse the entity_test ones in conjunction with node.
Comment #14
tim.plunkettWhile the entity_test entity types have no bundles created, they do have a bundle key. Not having one is a criteria to make this thing fail.
So this is what I've got, I think we're good enough to go with this.
Comment #15
yched CreditAttribution: yched commentedToo bad. This should probably be stated in the patch then, to avoid later merging by a good soul :-/
Comment #16
damiankloip CreditAttribution: damiankloip commentedThis makes sense, and is exposed nicely with the test.
Comment #17
alexpottCommitted a371a7b and pushed to 8.x. Thanks!
Added type: module to
core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.info.yml during commit...