1

Importing the following yml fails. With UUID it wants to be deleted. After removing the UUID it fails with field type doesn't exist. Any ideas? Is there some kind of order that might make the import fail.

uuid: null
langcode: de
status: true
dependencies:
  config:
    - field.storage.node.comment_forum
    - node.type.forum
  module:
    - comment
_core:
  default_config_hash: Tqw7kBEqm9_VZSK9bsNBAgJqAmJGP6cKEzXtf_KlqBo
id: node.forum.comment_forum
field_name: comment_forum
entity_type: node
bundle: forum
label: Comments
description: ''
required: true
translatable: true
default_value:
  -
    status: 2
    cid: 0
    last_comment_name: null
    last_comment_timestamp: 0
    last_comment_uid: 0
    comment_count: 0
default_value_callback: ''
settings:
  default_mode: 1
  per_page: 30
  form_location: true
  anonymous: 0
  preview: 1
field_type: comment

After doing a drush cex and reverting the affected file I now only have left those two lines when doing a drush cim. So the field seems to be created and deleted again. I can't find any config that is triggering that delete. Any clue?

enter image description here

3
  • Are you saying the field exists and this is an update? or is this a new field? For a new field I would remove the uuid line and remove the _core: default_config_hash lines as well. For an existing field, I would try to export the field from the system you're trying to import to and then replace the lines above (uuid and _core: default_config_hash) with the lines from the exported field. (Definitely backup your db first though)
    – sonfd
    Feb 21, 2019 at 16:24
  • Jupp its a new field - at least it doesn't appear in the node yet
    – macbert
    Feb 21, 2019 at 16:32
  • removing both lines still fail with The import failed due to the following reasons: Unexpected error during import with operation update for field.field.node.forum.comment_forum: Unable to determine class for field type '' found in the 'field.field.' configuration
    – macbert
    Feb 21, 2019 at 16:38

1 Answer 1

0

Okay, there was a second field.field.node.forum.comment_forum.yml in the code of a custom module. It was just a simple setting which sould rewrite the code above but lead into a conflicting import. It looks like the second yml file gets imported first. So far deleting the second yml file fixed the problem.

P.S. We will now try to find out why the rewrite doesn't work in the correct order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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