Score:0

Why my custom module configuration are not getting created on module install?

sj flag

I have created one custom module with config/install folder. This install folder contain content type yml. Basically on install of custom module new content type should be created. When I use drush en my_custom_module, all configuration are getting imported successfully. But when I do drush cim only module is installed but configuration(mycustommodule/config/install) are missing. Do we need to do any changes so that while doing global cim import it should import my config/install level configuration too.

4uk4 avatar
cn flag
Then the module was not correctly installed on the site where you run drush cex.
Sudha avatar
sj flag
I recheck multiple time but module is installed without any error but config/install is ignored. While doing cim I didn't found any error.
id flag
Did you export the configuration after installing the module?
Sudha avatar
sj flag
ok..Yes I export the configuration when my module was enable using drush cex. Then I placed all require yml file from config/sync folder to my custom module config folder ie config/install. So in short in core.extensions.yml file I have entry to enable my custom module. I tested with fresh database where my module is not install and tired drush cim. Without any error my module is getting install but config/install folder is ignored.
4uk4 avatar
cn flag
*I placed all require yml file from config/sync folder to my custom module config folder ie config/install* ... you don't need to do that when deploying through drush cex/cim.
Sudha avatar
sj flag
ok, means configuration present inside config/sync would only be imported. Actually my aim was to use this module in different site. So I was targeting that on doing drush cim, module should be install with its configuration. Thanks for the help :)
4uk4 avatar
cn flag
You know that drush cim/cex is only for cloned sites, not for different sites?
Sudha avatar
sj flag
Yes you are correct and I m absolutely aware of this.
I sit in a Tesla and translated this thread with Ai:

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.