ApiOptions: set form field parent earlier
authorGergő Tisza <tgr.huwiki@gmail.com>
Wed, 4 May 2016 15:09:18 +0000 (17:09 +0200)
committerGergő Tisza <tgr.huwiki@gmail.com>
Wed, 4 May 2016 15:09:18 +0000 (17:09 +0200)
Bug: T134351
Change-Id: I44b9bbd1663c876cf0c6160f10badfd8f380656b

includes/api/ApiOptions.php

index e51d46d..8bfe447 100644 (file)
@@ -86,8 +86,7 @@ class ApiOptions extends ApiBase {
                                                // We need a dummy HTMLForm for the validate callback...
                                                $htmlForm = new HTMLForm( [], $this );
                                        }
-                                       $field = HTMLForm::loadInputFromParameters( $key, $prefs[$key] );
-                                       $field->mParent = $htmlForm;
+                                       $field = HTMLForm::loadInputFromParameters( $key, $prefs[$key], $htmlForm );
                                        $validation = $field->validate( $value, $user->getOptions() );
                                        break;
                                case 'registered-multiselect':