From: Gergő Tisza Date: Wed, 4 May 2016 15:09:18 +0000 (+0200) Subject: ApiOptions: set form field parent earlier X-Git-Tag: 1.31.0-rc.0~7105^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22upgrade%22%2C%22reinstall=non%22%29%20.%20%22?a=commitdiff_plain;h=93c5cc236a84c1a334b9a596dbc0739ea9c28972;p=lhc%2Fweb%2Fwiklou.git ApiOptions: set form field parent earlier Bug: T134351 Change-Id: I44b9bbd1663c876cf0c6160f10badfd8f380656b --- diff --git a/includes/api/ApiOptions.php b/includes/api/ApiOptions.php index e51d46d91a..8bfe447df5 100644 --- a/includes/api/ApiOptions.php +++ b/includes/api/ApiOptions.php @@ -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':