Apply patch 2363693-1

* Several fatal error when an entity content generated is referenced
  from an other entity, or an entity content is referencing other entity
* Drupal Issue: https://www.drupal.org/node/2363693