diff --git a/forms/InlineFormAction.php b/forms/InlineFormAction.php index 4e8984876..9e5066750 100644 --- a/forms/InlineFormAction.php +++ b/forms/InlineFormAction.php @@ -20,7 +20,7 @@ class InlineFormAction extends FormField { */ public function __construct($action, $title = "", $extraClass = '') { $this->extraClass = ' '.$extraClass; - parent::__construct($action, $title, null, null); + parent::__construct($action, $title); } public function performReadonlyTransformation() { @@ -39,7 +39,8 @@ class InlineFormAction extends FormField { return DBField::create_field( 'HTMLText', - FormField::create('input', array( + FormField::create_tag('input', array( + 'type' => 'submit', 'name' => sprintf('action_%s', $this->getName()), 'value' => $this->title, 'id' => $this->ID(), diff --git a/tests/forms/InlineFormActionTest.php b/tests/forms/InlineFormActionTest.php new file mode 100644 index 000000000..89ad65e1d --- /dev/null +++ b/tests/forms/InlineFormActionTest.php @@ -0,0 +1,18 @@ +Field(); + $this->assertContains('assertContains('type="submit"', $html); + $this->assertContains('name="action_dothing"', $html); + $this->assertContains('value="My Title"', $html); + $this->assertContains('id="dothing"', $html); + $this->assertContains('class="action ss-action"', $html); + } +}