Skip to content
Snippets Groups Projects

Minimal duplicate create hook implementation

Files

@@ -1217,6 +1217,11 @@ public function createDuplicate() {
$duplicate->loadedRevisionId = NULL;
}
// Modules might need to add or change the data initially held by the new
// entity object, for instance to fill-in default values.
\Drupal::moduleHandler()->invokeAll($this->getEntityTypeId() . '_duplicate', [$duplicate, $this]);
\Drupal::moduleHandler()->invokeAll('entity_duplicate', [$duplicate, $this]);
return $duplicate;
}
Loading