Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / ENTITY_TYPE_revision_create.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_revision_create.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_revision_create.twig
new file mode 100644 (file)
index 0000000..ed6a011
--- /dev/null
@@ -0,0 +1,8 @@
+/**
+ * Implements hook_ENTITY_TYPE_revision_create().
+ */
+function {{ machine_name }}_ENTITY_TYPE_revision_create(Drupal\Core\Entity\EntityInterface $new_revision, Drupal\Core\Entity\EntityInterface $entity, $keep_untranslatable_fields) {
+  // Retain the value from an untranslatable field, which are by default
+  // synchronized from the default revision.
+  $new_revision->set('untranslatable_field', $entity->get('untranslatable_field'));
+}