HTMLFormFieldCloner: Make sure the delete and create buttons have a parent
authorKunal Mehta <legoktm@gmail.com>
Thu, 11 Sep 2014 16:47:26 +0000 (09:47 -0700)
committerKunal Mehta <legoktm@gmail.com>
Thu, 11 Sep 2014 16:53:40 +0000 (09:53 -0700)
Also fix the type in documentation.

Change-Id: I0fee2dbb9dd1db157acfba2063a2e4e40152cddf

includes/htmlform/HTMLFormFieldCloner.php

index 597a03f..029911c 100644 (file)
@@ -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;