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
\Drupal\Core\Entity\EntityManager
uses the discovery method \Drupal\Core\Plugin\DefaultPluginManager
sets. This includes support for derivers, but entity types cannot be derived, as colons in entity type IDs are not allowed due to restrictions in config storage and route requirements where colons are disallowed.
Proposed resolution
Explicitly remove support for derivers.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#1 | drupal_2470924_1.patch | 1.75 KB | Xano |
#1 | drupal_2470924_proof_of_bug-do-not-test.patch | 491 bytes | Xano |
Comments
Comment #1
XanoHere are a patch that expose the fact that derivers are run, and a fix for the bug.
Comment #2
tim.plunkettThis is another example of where #2422815: Don't initialize the discovery object in plugin managers, unless needed would be nice
Comment #3
XanoAlso,
DerivativeDiscoveryDecorator::mergeDerivativeDefinition()
will not work with non-array definitions.Comment #4
XanoAs mentioned on IRC, #2458789: Introduce PluginDefinitionInterface can introduce support for 'internal' definition merges. This means that theoretically we can re-introduce derivative support to entities in the future.
I discussed this issue with berdir at Drupal Dev Days and our conclusion was to just remove the illusion of support for now and get this issue in.
Comment #5
BerdirI think this makes sense, making it look like derivatives work is currently misleading and they would be very broken. We can still make it nicer in the other issue, it doesn't have to block this.
Comment #6
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed a336347 and pushed to 8.0.x. Thanks!