How are Field API fields transfered from config entities to content entities?


This works essentially the same way as in Drupal 7.

Config entities like node types, custom block types, vocabularies and so on are used as storage and are then exposed as bundles of nodes, custom blocks, taxonomy terms, ...

There's not much magic involved, you can see what happens in e.g. node_entity_bundle_info() and taxonomy_entity_bundle_info(), so the modules have to do that part themself, you'll notice small differences there e.g. how they handle the bundle label.

The bundle_of annotation key was added recently that allows to explicitly define that relationship between two entity types, but it's currently only used by field_ui_entity_operation_alter() to automatically add operation links to the listings of node types, vocabularies and so on.

While it looks like you add the fields to config entities, you really add the field to the corresponding content entity for the given bundle. Just like it already was in 7.x, the only thing that really changed is all those different things now use the same API for storage, in 7.x, they were stored in separate tables and didn't have anything in common.

Tags: Entities / Drupal 8

Similar questions

How can I read config schema from a config entity?
I need to read the schema definition from a config entity, which is located in config/schema. For example the schema from a node type defined in node.schema.yml: How can I do this?
How can I get single keys in multi-item config objects using debug:config?
For example, in drush I can run drush cget search_api.server.iges_solr backend_config.connector_config.port and get a useful answer. ('search_api.server.iges_solr:backend_config.connector_config.port': 8988) In Drupal Console, I've tried the same formatting as in the drush command, I've tried a colon between the main config item, and the sub item (...
Why is config for my view going to config/local?
We use config_split to slice off parts of the site config to other config folders (local, dev, stage, etc). This more or less works as expected. I have one view which always exports to config/local even though there is nothing I can see in the config_split configuration which is suggesting it do this. Any ideas why it fails to export to the correct...
drush config-status on translation / language config files?
Similar with but not the same as How to use drush config:set for translations?, is there a way to scan for a site's language config changes via drush or so? I have a lot of sites on the same server (multi-site), and I would rather check on this via a drush command than having to log in each of the sites to look at the output of /admin/config/develo...
config-import error: These entities need to be deleted before importing
I have two Drupal environments with the same In the main Drupal I export the configuration with command: In the destination drupal I import the configuration with command: But I have this error Entities exist of type Shortcut link and Default. These entities need to be deleted before importing. And: Unable to install the mytest the...
Is it possible to define default config entities in a single yml file?
Following drupal handbook I've created configuration entity type. All works fine except that I have to create ~100 default entities. It would be significantly easier to maintain these default entities if I could define them in a single YML file but that does not work as expected. If I create files like this: The config entities are created correctl...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.