diff --git a/code/GridFieldCopyButton.php b/code/GridFieldCopyButton.php index c4cbb0f..ae7eb70 100644 --- a/code/GridFieldCopyButton.php +++ b/code/GridFieldCopyButton.php @@ -48,7 +48,7 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat if($actionName == 'copyrecord'){ $item = $gridField->getList()->byID($arguments['RecordID']); if(!$item) return; - + if(!$item->canCreate()) { throw new ValidationException( _t('GridFieldAction_Copy.CreatePermissionsFailure',"No create permissions"),0); @@ -58,7 +58,7 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat if (!$clone || $clone->ID < 1) { user_error("Error Duplicating!", E_USER_ERROR); } - } + } } } diff --git a/lang/en.yml b/lang/en.yml index f6e9e72..560724c 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -2,3 +2,6 @@ en: GridAction: COPY_DESCRIPTION: 'Copy' Copy: 'Copy' + + GridFieldAction_Copy: + CreatePermissionsFailure: 'No create permissions' diff --git a/lang/lt.yml b/lang/lt.yml index 10909cd..676d1df 100644 --- a/lang/lt.yml +++ b/lang/lt.yml @@ -2,3 +2,6 @@ lt: GridAction: COPY_DESCRIPTION: 'Kopijuoti' Copy: 'Kopijuoti' + + GridFieldAction_Copy: + CreatePermissionsFailure: 'Neturite teisių sukurti/kopijuoti įrašą'