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.

Comments

joachim created an issue. See original summary.

joachim’s picture

Issue tags: +Release blocker
joachim’s picture

Note 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.

joachim’s picture

martin107’s picture

This 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.

martin107’s picture

Status: Needs review » Reviewed & tested by the community

I am happy...

  • socketwench committed bfc6f21 on 8.x-4.x authored by martin107
    Issue #2841383 by joachim, martin107: Fixed flags that use the derived...
socketwench’s picture

Status: Reviewed & tested by the community » Fixed

I am not happy...with life in general.

This patch is good, though.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.