Over in paragraphs_base we have several paragraphs sharing some fields (and image styles).

What we need is a way to make features generate
* paragraph bundle feature modules
* and feature modules for each field storage that can be used and shared by the paragraph bundles

Putting all field storage into a core feature is not a good solution here, as people using one field end up having to install all dependencies of all field storages.

Comments

axel.rutz created an issue. See original summary.

geek-merlin’s picture

Issue summary: View changes
geek-merlin’s picture

Hmm, to be more precise, i think the "Core type" assignment method might help a bit, but it creates only one core package with all field storage items, with the result that if we install one paragraph type, we need all field storage items with all their dependencies.

nedjo’s picture

If your field belongs only in one feature, name the field accordingly. Example: if you have a field that's to be attached to the article content type, name it field_article_type. With the default assignment plugin configuration, this will lead to your field storage being added to the article feature.

If the field storage should be reused across multiple features, it's appropriately assigned to a core feature as generated by the core feature assignment plugin. And, yes, the core feature will be dependent on all modules required by one or more of the field storages.

I wrote the Configuration Share module to address config and module dependency issues for configuration that's shared across multiple features. See that project's page for developer usage.

geek-merlin’s picture

Hmm so the core issue is essentially unresolved and we either improve features or work around the problem.
Imho a features field-storage assignment plugin is the way to go.
Until we have that we're stuck with a core component that for most users adds many bogus dependencies (e.g. for paragraphs_base where each paragraph type has different dependencies and a typical user will only enable a small subset).

geek-merlin’s picture

Title: How to reuse field storage » Field storage assignment plugin
Category: Support request » Feature request
Issue summary: View changes
nedjo’s picture

Imho a features field-storage assignment plugin is the way to go.

Can you explain what such a plugin would do?

geek-merlin’s picture

> Can you explain what such a plugin would do?
Allow me to have my field bases in separate modules.

nedjo’s picture

Allow me to have my field bases in separate modules.

If you want a different module per field storage, you can try selecting field storage as one of the configuration types for the base assignment plugin.

geek-merlin’s picture

Title: Field storage assignment plugin » Allow field storage as base type

> If you want a different module per field storage, you can try selecting field storage as one of the configuration types for the base assignment plugin.

Right, that would be natural.

Alas, under admin/config/development/features/bundle/_base/paragraphs_base i only have this. Dunno why.

Configuration types

  • Comment type
  • Contact form
  • Content type
  • Custom block type
  • Paragraphs type
  • Shortcut set
  • Taxonomy vocabulary

Select types of configuration that should be considered base types.

Content entity types

  • Custom menu link
  • File
  • Simplenews subscriber
  • User

Select content entity types that should be considered base types.

nedjo’s picture

Ah, right.

IIRC, when I wrote this plugin, I restricted the selection to entity types that are bundles (like node types and taxonomy vocabularies), since I didn't see a valid use case for other configuration types and didn't want to offer a UI that included inappropriate options.

We could consider relaxing this restriction. E.g., by default hide non-bundle configuration types, so the checkboxes are those that currently display, but offer an advanced option that, if checked, will show all configuration types.

geek-merlin’s picture

> but offer an advanced option that, if checked, will show all configuration types.

Or just hide them in a details fieldset...