OOUIHTMLForm: Access context after parent constructor is called
authorKunal Mehta <legoktm@gmail.com>
Thu, 28 May 2015 06:02:58 +0000 (23:02 -0700)
committerKunal Mehta <legoktm@gmail.com>
Thu, 28 May 2015 06:02:58 +0000 (23:02 -0700)
This avoids "ContextSource::getContext (OOUIHTMLForm): called and $context
is null. Using RequestContext::getMain() for sanity"

Change-Id: I20c2bb58b3a0e5e259241a3715ee8fdf4b57e148

includes/htmlform/OOUIHTMLForm.php

index 60e6366..6c9952a 100644 (file)
@@ -32,10 +32,10 @@ class OOUIHTMLForm extends HTMLForm {
        protected $mWrapperLegend = false;
 
        public function __construct( $descriptor, $context = null, $messagePrefix = '' ) {
+               parent::__construct( $descriptor, $context, $messagePrefix );
                $this->getOutput()->enableOOUI();
                $this->getOutput()->addModules( 'mediawiki.htmlform.ooui' );
                $this->getOutput()->addModuleStyles( 'mediawiki.htmlform.ooui.styles' );
-               parent::__construct( $descriptor, $context, $messagePrefix );
        }
 
        /**