API: Clean up uncaught exception backtrace output
[lhc/web/wiklou.git] / includes / api / ApiQueryInfo.php
index 7ecb429..e6667b4 100644 (file)
@@ -58,10 +58,10 @@ class ApiQueryInfo extends ApiQueryBase {
         */
        public function requestExtraData( $pageSet ) {
                $pageSet->requestField( 'page_restrictions' );
-               // when resolving redirects, no page will have this field
-               if ( !$pageSet->isResolvingRedirects() ) {
-                       $pageSet->requestField( 'page_is_redirect' );
-               }
+               // If the pageset is resolving redirects we won't get page_is_redirect.
+               // But we can't know for sure until the pageset is executed (revids may
+               // turn it off), so request it unconditionally.
+               $pageSet->requestField( 'page_is_redirect' );
                $pageSet->requestField( 'page_is_new' );
                $config = $this->getConfig();
                $pageSet->requestField( 'page_touched' );
@@ -70,6 +70,9 @@ class ApiQueryInfo extends ApiQueryBase {
                if ( $config->get( 'ContentHandlerUseDB' ) ) {
                        $pageSet->requestField( 'page_content_model' );
                }
+               if ( $config->get( 'PageLanguageUseDB' ) ) {
+                       $pageSet->requestField( 'page_lang' );
+               }
        }
 
        /**
@@ -101,7 +104,7 @@ class ApiQueryInfo extends ApiQueryBase {
                        'import' => array( 'ApiQueryInfo', 'getImportToken' ),
                        'watch' => array( 'ApiQueryInfo', 'getWatchToken' ),
                );
-               wfRunHooks( 'APIQueryInfoTokens', array( &$this->tokenFunctions ) );
+               Hooks::run( 'APIQueryInfoTokens', array( &$this->tokenFunctions ) );
 
                return $this->tokenFunctions;
        }
@@ -460,7 +463,7 @@ class ApiQueryInfo extends ApiQueryBase {
                                $pageInfo['preload'] = '';
                        } else {
                                $text = null;
-                               wfRunHooks( 'EditFormPreloadText', array( &$text, &$title ) );
+                               Hooks::run( 'EditFormPreloadText', array( &$text, &$title ) );
 
                                $pageInfo['preload'] = $text;
                        }
@@ -808,7 +811,9 @@ class ApiQueryInfo extends ApiQueryBase {
                                        'displaytitle',
                                        // If you add more properties here, please consider whether they
                                        // need to be added to getCacheMode()
-                               ) ),
+                               ),
+                               ApiBase::PARAM_HELP_MSG_PER_VALUE => array(),
+                       ),
                        'token' => array(
                                ApiBase::PARAM_DEPRECATED => true,
                                ApiBase::PARAM_DFLT => null,