diff --git a/src/Forms/CopyLocaleAction.php b/src/Forms/CopyLocaleAction.php index e0741e32..e7cb75c6 100644 --- a/src/Forms/CopyLocaleAction.php +++ b/src/Forms/CopyLocaleAction.php @@ -106,6 +106,10 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat } $destinationState->setLocale($toLocale->getLocale()); + $fromLocale = $arguments['FromLocale']; + $toLocale = $arguments['ToLocale']; + $record->invokeWithExtensions('onBeforeCopyLocale', $fromLocale, $toLocale); + // Write /** @var DataObject|Versioned $record */ if ($record->hasExtension(Versioned::class)) { @@ -114,6 +118,8 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat $record->forceChange(); $record->write(); } + + $record->invokeWithExtensions('onAfterCopyLocale', $fromLocale, $toLocale); }); }); }