I have the forward dependency plugin enabled for my Feature bundle, so I would expect that if configuration Foo depends on configuration Bar, Features will automatically include Bar whenever I select Foo. This does not happen consistently in practice.

For instance, if you create a new content type with a field, Drupal also creates an entity view display mode that explicitly depends on that field and content type. Similarly, the created field also depends on its field storage. But if you go to create a new Feature and just check the entity view mode, the field and content type don't get included. Similarly, if you just check the field instance, the field storage isn't included.

Now obviously the "correct" way to export a content type and its field is to just check the content type, and in that case all of the fields and display modes to get included as expected. But the weird thing is that the content type config itself doesn't explicitly depend on these things... so how are they getting picked up? I suspect it's because the bundle configuration sets "content type" as a "base type". But that doesn't work if you're exporting the content type (or other entity "base type" such as a Paragraph) within another Feature.

The final bit of weirdness: if you select a field storage config, it's corresponding field and display mode will be automatically selected, which indicates that Features is actually working up the dependency chain in general rather than down it. But this isn't completely reproduceable--if I select a paragraph type, it's corresponding display modes and fields (which depend on it) aren't selected.

All in all... I'm really confused about how dependency detection is supposed to work.

Comments

Dane Powell created an issue. See original summary.

nedjo’s picture

Category: Bug report » Feature request

Definitely we have a complex series of interactions here.

Because this is a mix of a bunch of potential issues and questions, I'm turning this for now into a support request. If we refine it to a particular bug or bugs, we can switch it back, and/or open new issues.

Some initial comments:

  • We do dependency detection in both directions, with the two dependency-related assignment plugins. You could try reordering them and/or selectively disabling them to see what results you get.
  • The forward dependency plugin has code doesn't add a "forward" dependency if it's required by more than one package/features, so that's one thing to check.
nedjo’s picture

Status: Active » Fixed

This looks like a support request that was answered. Please feel free to reopen if otherwise.

Status: Fixed » Closed (fixed)

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