* Constructor for OutputPage. This should not be called directly.
* Instead a new RequestContext should be created and it will implicitly create
* a OutputPage tied to that context.
+ * @param IContextSource|null $context
*/
function __construct( IContextSource $context = null ) {
if ( $context === null ) {
/**
* Set the URL to be used for the <link rel=canonical>. This should be used
* in preference to addLink(), to avoid duplicate link tags.
+ * @param string $url
*/
function setCanonicalUrl( $url ) {
$this->mCanonicalUrl = $url;
* @param array $categories Mapping category name => sort key
*/
public function addCategoryLinks( array $categories ) {
- global $wgContLang;
+ global $wgContLang, $wgContentHandlerUseDB;
if ( !is_array( $categories ) || count( $categories ) == 0 ) {
return;
# Fetch existence plus the hiddencat property
$dbr = wfGetDB( DB_SLAVE );
+ $fields = array( 'page_id', 'page_namespace', 'page_title', 'page_len',
+ 'page_is_redirect', 'page_latest', 'pp_value' );
+
+ if ( $wgContentHandlerUseDB ) {
+ $fields[] = 'page_content_model';
+ }
+
$res = $dbr->select( array( 'page', 'page_props' ),
- array( 'page_id', 'page_namespace', 'page_title', 'page_len',
- 'page_is_redirect', 'page_latest', 'pp_value' ),
+ $fields,
$lb->constructSet( 'page', $dbr ),
__METHOD__,
array(),