From 791d71bd5147f68673c2ef78aa62cfa043573037 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 11 Sep 2014 09:47:26 -0700 Subject: [PATCH] HTMLFormFieldCloner: Make sure the delete and create buttons have a parent Also fix the type in documentation. Change-Id: I0fee2dbb9dd1db157acfba2063a2e4e40152cddf --- includes/htmlform/HTMLFormFieldCloner.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/htmlform/HTMLFormFieldCloner.php b/includes/htmlform/HTMLFormFieldCloner.php index 597a03f2ea..029911cdde 100644 --- a/includes/htmlform/HTMLFormFieldCloner.php +++ b/includes/htmlform/HTMLFormFieldCloner.php @@ -80,7 +80,7 @@ class HTMLFormFieldCloner extends HTMLFormField { * specified key. * * @param string $key Array key under which these fields should be named - * @return HTMLFormFields[] + * @return HTMLFormField[] */ protected function createFieldsForKey( $key ) { $fields = array(); @@ -303,6 +303,7 @@ class HTMLFormFieldCloner extends HTMLFormField { 'cssclass' => 'mw-htmlform-cloner-delete-button', 'default' => $this->msg( $label )->text(), ) ); + $field->mParent = $this->mParent; $v = $field->getDefault(); if ( $displayFormat === 'table' ) { @@ -373,6 +374,7 @@ class HTMLFormFieldCloner extends HTMLFormField { 'cssclass' => 'mw-htmlform-cloner-create-button', 'default' => $this->msg( $label )->text(), ) ); + $field->mParent = $this->mParent; $html .= $field->getInputHTML( $field->getDefault() ); return $html; -- 2.20.1