The Flag Type plugin uses a deriver so that there's a derived plugin for any entity type that doesn't specifically provide a plugin.
However, Flag entities that use one of these don't declare the entity type's module as a dependency.
Eg, Taxonomy terms don't have a plugin class, so use EntityFlagType. A flag on taxonomy terms won't declare taxonomy module as a dependency.
This is incorrect, as the flag can't function without the flaggable entity type it's defined for.
Fix as described at https://www.drupal.org/node/2716613#comment-11852279 :
See \Drupal\field_test\Plugin\Field\FieldType\TestItemWithDependencies, plugin annotations/definitions can have a config_dependencies key, which you can easily set from the deriver, just put something like
'config_dependencies' => ['module'] = [$entity_type->getProvider()]] in there.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | reroll-2841383-6.patch | 1.41 KB | martin107 |
Comments
Comment #2
joachim commentedComment #3
joachim commentedNote that this won't fix existing flags (which is fine because we're still in alpha).
To test this manually, you need to create a new flag once the patch has been applied.
Comment #5
joachim commentedComment #6
martin107 commentedThis patch needed rerolling ....
No conflicts just a little 3 way merging...
The chain of logic expressed in this issue seems sound ....
I am uploading .. to see what testbot has to say ...
I will think about this issue in the inbetweening time with a view to RTBC'ing it soon.
Comment #7
martin107 commentedI am happy...
Comment #9
socketwench commentedI am not happy...with life in general.
This patch is good, though.