3

I am getting the following error:

Drupal\Core\Field\FieldException: Attempt to create a field body that does not exist on entity type node. in Drupal\field\Entity\FieldConfig->getFieldStorageDefinition() (line 286 of core/modules/field/src/Entity/FieldConfig.php).

Context is that I recently switched from one branch to another and did some config imports.

My guess is that this is related to a field.storage issue? What precisely would be causing this error? I'd provide more information about my content types, but I really don't know at this point where it can be narrowed down to.

I'm not finding any real sources on this particular error.

6

You attempted to create a field using configuration without creating the field storage configuration.

In the field configuration YAML you can see a field_storage property. That is the id of the field storage configuration that needs to also be imported.

  • What particular piece of YAML would it be in? I searched the entire directory (especially the field.field.node.article.body, etc, etc) for field_storage and was unable to find anything – Jack Ryan Jan 24 '17 at 21:50
  • 1
    I think you are missing the field.storage.node.body configuration. You can copy the base configuration from the node module (core/modules/node/config/install/field.storage.node.body.yml) – Eyal Jan 24 '17 at 21:54
  • No, I've absolutely got it, in both YML and I put it into my database before posting here. – Jack Ryan Jan 24 '17 at 21:59
  • a:17:{s:4:"uuid";s:36:"230952c6-9c0c-4a0f-b8ac-dba902e8e8e8";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"module";a:2:{i:0;s:4:"node";i:1;s:4:"text";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"EBUo7qOWqaiZaQ_RC9sLY5IoDKphS34v77VIHSACmVY";}s:2:"id";s:9:"node.body";s:10:"field_name";s:4:"body";s:11:"entity_type";s:4:"node";s:4:"type";s:17:"text_with_summary";s:8:"settings";a:0:{}s:6:"module";s:4:"text";s:6:"locked";b:0;s:11:"cardinality";i:1;s:12:"translatable";b:1;s:7:"indexes";a:0:{}s:22:"persist_with_no_fields";b:1;s:14:"custom – Jack Ryan Jan 24 '17 at 22:00
  • 1
    Oh, it worked, I just had to completely kill my VM and restart it to make it recognize it correctly. – Jack Ryan Jan 24 '17 at 22:03

protected by Community Feb 14 at 7:50

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.