In this blog, I’ll be listing a few modules along with our personal experience and the reason why you should avoid them . Of course, this information might become out of date in a while as modules get updated and bugs are fixed. That’s why I am also listing the module versions we used.

As the website would be very rich in content, our client asked for the possibility to clone entities so content could easily be reused. Since the options were very limited at the time, we chose to try out entity_clone, a brand new Drupal 8 module which aims to be able to clone any entity. Pretty cool!

Unfortunately there hasn’t been any real development since April thus the module still had some gaps in functionality. For example, we noticed some strange behavior on the website when our client started working on the content. Entities, images and files were disappearing and changing on random pages. It turns out that the entity_clone module doesn’t really support referenced entities yet when cloning, it just makes the clone point to the same attached entities.

That means if you clone a node, and for example remove the teaser image to replace it, that image is also removed from the original node since both nodes point to the same file ID. The same thing happened with field collections and other referenced entities. There is an active issue on drupal.org which addresses this problem. As this was a blocking problem for us, we considered the module unusable, and the website started behaving normal again after uninstalling entity_clone. We did have to check all cloned entities to see whether they were still referencing entities from their original versions.

Alternatives

The node_clone module is now being ported to Drupal 8 and Replicate might also be an option (we haven’t tested those yet).

Field Collection (8.x-1.0-alpha1)

Field Collections are great if you want to re-use groups of fields across various entity types. Unfortunately we discovered that field collections don’t support translations yet, see this issue. So if you are developing a multilingual site, stay away from the field_collection module until the 8.x-3.x branch has a stable release. If you do want to use field_collection, take into account that those fields won’t be translated when viewing your node in another language.

Alternatives

There are some alternative modules with similar functionality, but we prefer creating custom entities. When using Drupal Console, it’s pretty easy to generate those. Also, there is a development branch for a 8.x-3.x release of the module which will include multilingual support.

ECK (8.x-1.0-alpha1)

ECK is great in Drupal 7. The module enables the administrator to create custom entities on the fly straight from the UI. For a short while we used ECK in our Drupal 8 projects to achieve the same goal, but then we noticed some bugs when translating entities through an inline entity form on a node.

When looking for an alternative, we quickly discovered that Drupal Console offers the ability to generate custom content/config entities and custom bundles. These entities behave just like those from ECK, but they are provided by Drupal core. That means one less dependency and a smaller chance to encounter bugs. After the console generated the necessary classes you can easily alter them as you please, something that is less easy to do with ECK