From d531356863a48ab27d0516874d96781aa189f4d3 Mon Sep 17 00:00:00 2001 From: Ryan Potter Date: Mon, 1 Jul 2019 10:32:19 +1200 Subject: [PATCH] Set docblock for the setButtonName method, and don't invalidate localisation text. --- .gitignore | 1 - src/Forms/GridField/GridFieldAddByDBField.php | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index bbe398c..80e016d 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /vendor/* -/.idea .sass-cache/* /node_modules/ **/*.js.map diff --git a/src/Forms/GridField/GridFieldAddByDBField.php b/src/Forms/GridField/GridFieldAddByDBField.php index 7a4b06f..43a0c43 100644 --- a/src/Forms/GridField/GridFieldAddByDBField.php +++ b/src/Forms/GridField/GridFieldAddByDBField.php @@ -152,7 +152,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP /** * Set the button name * - * @param $name + * @param $name string * @return $this */ public function setButtonName($name) @@ -211,7 +211,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP if (!$this->buttonName) { // provide a default button name, can be changed by calling {@link setButtonName()} on this component $objectName = $obj->i18n_singular_name(); - $this->buttonName = _t(__CLASS__ . '.ButtonName', 'Add {name}', array('name' => $objectName)); + $this->buttonName = _t(__CLASS__ . '.ButtonName', '{name}', ['name' => $objectName]); } $addAction = GridField_FormAction::create( @@ -219,7 +219,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP 'add', _t( __CLASS__ . '.Add', - '{name}', + 'Add {name}', 'Add button text', ['name' => $this->buttonName] ),