diff --git a/lang/en.yml b/lang/en.yml index f6f7338a..fef01ff4 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -1,6 +1,4 @@ en: - LeftAndMain: - SAVEDERROR: Error. SilverStripe\CampaignAdmin\AddToCampaignHandler: AddToCampaignAddAction: Add AddToCampaignAvailableLabel: 'Available campaigns' @@ -20,4 +18,5 @@ en: ERROR_DUPLICATE_NAME: 'Name "{Name}" already exists' MENUTITLE: Campaigns SAVE: Save + SAVEDERROR: Error. SAVEDUP: Saved. diff --git a/src/CampaignAdmin.php b/src/CampaignAdmin.php index eecd8ddb..9135d1ef 100644 --- a/src/CampaignAdmin.php +++ b/src/CampaignAdmin.php @@ -620,7 +620,7 @@ public function save($data, $form) $nameDuplicateMsg = _t(__CLASS__ . '.ERROR_DUPLICATE_NAME', 'Name "{Name}" already exists', '', [ 'Name' => $data['Name']]); $errors = new ValidationResult(); $errors->addFieldMessage('Name', $nameDuplicateMsg); - $message = _t('LeftAndMain.SAVEDERROR', 'Error.'); + $message = _t(__CLASS__.'.SAVEDERROR', 'Error.'); // Need to set the form message or the field message won't show up at all $form->setMessage($message, ValidationResult::TYPE_ERROR); }