Score:1

Creating default content on site install with related entities

cn flag

We use the Default Content module to install default content on each new site of our multi-site Drupal platform. Version 2 changed to only use UUID of the content you are exporting (done from the local development environment to generate content). However, some of our default content are items like vocabulary terms which are then related to the node. But this is no longer exporting the ID, so the ID when created in the new site can be different and now the newly created node on the site has a vocabulary term that it shouldn't.

How do related entities work with uuid? If a new taxonomy term is created and then used in a node, the node stores the "ID" of the taxonomy term. How will that term get exported and created with the proper IDs so that the node will have the proper value in the entity field?

apaderno avatar
us flag
The module uses UUID for any exported entity, and set the UUID after creating the imported entity, throwing an error if the UUID is already used on the site. In this way, the imported entities are recreated as they were on the site where they have been exported.
shelane avatar
cn flag
Understandable. I’m creating a brand new site that will include views with preset filters of taxonomy terms. Everything has to done from local before being deployed to the server. Since terms are content, I have to have this ready with the installation of the site. And I am still creating features locally, so I must often test a rebuild. Views are not filtering on the UUID. My current work around is deploy hook and manually creating the content, so I didn’t use default content module for this. But I’m thinking of other applications as well.
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.