Score:2

How can I update an entity with a .yml file?

gb flag

I see that EntityDefinitionUpdateManager::applyUpdates() has been removed.

Every time I add a new field to a .yml file or I add a new node.type.yml to the configuration directory in a module I am developing, I reinstall the module to see newly added fields.

Introduction to update API for Drupal 8 shows an example where hook_update_N() reads .yml files one by one. It would be very inefficient 100 and more .yml files.

I found another packet that allows you to use applyUpdate() method but it corrupts the other configuration objects.

I also tried with drush config:import --source=module/config/install, but it corrupts other configuration objects.

Is there a way to update entities using .yml files?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.