ApiPageSet lazy loads content models
authorErik Bernhardson <ebernhardson@wikimedia.org>
Wed, 14 Jan 2015 18:50:18 +0000 (10:50 -0800)
committerAnomie <bjorsch@wikimedia.org>
Fri, 23 Jan 2015 21:58:52 +0000 (21:58 +0000)
A preceding patch, I7eff0bff, adjusts multiple Title methods to load the
content model from the database if it is not known.  This patch
adjusts ApiPageSet to query for the content model with the initial data
load rather than allowing the lazy loading to pull in the content
model one at a time as requested.
`
Bug: T86612
Change-Id: I9a9272da729d9323efde76a3c0a09f55127db537

includes/api/ApiPageSet.php

index 981c119..e53e2b2 100644 (file)
@@ -315,6 +315,10 @@ class ApiPageSet extends ApiBase {
                        $pageFlds['page_is_redirect'] = null;
                }
 
+               if ( $this->getConfig()->get( 'ContentHandlerUseDB' ) ) {
+                       $pageFlds['page_content_model'] = null;
+               }
+
                // only store non-default fields
                $this->mRequestedPageFields = array_diff_key( $this->mRequestedPageFields, $pageFlds );