Skip to content

Commit

Permalink
FIX: Correct the save button label.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfendeksilverstripe committed Sep 19, 2024
1 parent f90adbd commit a8f68c2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Form/FormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use LogicException;
use SilverStripe\Admin\Forms\LinkFormFactory;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\HiddenField;
use SilverStripe\ORM\DataObject;

Expand All @@ -28,6 +29,19 @@ protected function getFormFields($controller, $name, $context)
return $fields;
}

protected function getFormActions($controller, $name, $context)
{
$actions = parent::getFormActions($controller, $name, $context);

/** @var FormAction $insertAction */
$insertAction = $actions->fieldByName('action_insert');

// Update action button to be more descriptive
$insertAction?->setTitle(_t('SilverStripe\\Forms\\GridField\\GridFieldDetailForm.Save', 'Save'));

return $actions;
}

protected function getValidator($controller, $name, $context)
{
return null;
Expand Down

0 comments on commit a8f68c2

Please sign in to comment.