I have a development site (let be site 1) and a site where I check my code (site 2). My goal was to add a new existing field to a paragraphs type (/admin/structure/paragraphs_type), so I did the following:
On site 1:
- I re-used an existing field in one of the paragraphs type
- I exported the configuration
- I deleted uuid and _core.default_config_hash from the configuration files (from those which was relevant for me)
- I wrote an update hook which will create the same config file (except order), when my module will be updated on other sites, where it was previously installed my module
- I put the exported 3 files to my module's config/optional dir
Than I moved this module to the site 2 where I run the update hooks. But the newly added field wasn't showed up on the paragraphs type's page under the correct paragraphs type. All the configuration's dependencies are right and enabled. Configuration file is same except the order. If I want to add the field on site 2 manually again, after config import I get this error: There was a problem creating field : 'field_config' entity with ID 'paragraph.text_boxes.field_text' already exists.
Note: before I added the new field, I had a configuration export under git, so after I added a new field and exported the configuration I saw exactly which configs was touched.
What am I doing wrong? How can I add a new existing field to a paragraphs (or a content type)? What's missing?