jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/318695 )

Change subject: Fix linking Special:ChangeContentModel from action=info
......................................................................


Fix linking Special:ChangeContentModel from action=info

Just link the special page, when it is there, means checking
$wgContentHandlerUseDB

Change Title::quickUserCan to Title::userCan and pass a user object to
avoid a global..
Change some other places to use the local variable, instead of calling
the context source again.

Change-Id: I561899446235165fb77b626b55f35ce716d798c9
---
M includes/actions/InfoAction.php
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php
index be3be85..705f5fd 100644
--- a/includes/actions/InfoAction.php
+++ b/includes/actions/InfoAction.php
@@ -262,7 +262,7 @@
                $pageLang = $title->getPageLanguage()->getCode();
 
                if ( $config->get( 'PageLanguageUseDB' )
-                       && $this->getTitle()->userCan( 'pagelang', 
$this->getUser() )
+                       && $title->userCan( 'pagelang', $user )
                ) {
                        // Link to Special:PageLanguage with pre-filled page 
title if user has permissions
                        $titleObj = SpecialPage::getTitleFor( 'PageLanguage', 
$title->getPrefixedText() );
@@ -282,7 +282,9 @@
                // Content model of the page
                $modelHtml = htmlspecialchars( 
ContentHandler::getLocalizedName( $title->getContentModel() ) );
                // If the user can change it, add a link to 
Special:ChangeContentModel
-               if ( $title->quickUserCan( 'editcontentmodel' ) ) {
+               if ( $config->get( 'ContentHandlerUseDB' )
+                       && $title->userCan( 'editcontentmodel', $user )
+               ) {
                        $modelHtml .= ' ' . $this->msg( 'parentheses' 
)->rawParams( $linkRenderer->makeLink(
                                SpecialPage::getTitleValueFor( 
'ChangeContentModel', $title->getPrefixedText() ),
                                $this->msg( 'pageinfo-content-model-change' 
)->text()
@@ -474,7 +476,7 @@
                        }
                        $expiry = $title->getRestrictionExpiry( 
$restrictionType );
                        $formattedexpiry = $this->msg( 'parentheses',
-                               $this->getLanguage()->formatExpiry( $expiry ) 
)->escaped();
+                               $lang->formatExpiry( $expiry ) )->escaped();
                        $message .= $this->msg( 'word-separator' )->escaped() . 
$formattedexpiry;
 
                        // Messages: restriction-edit, restriction-move, 
restriction-create,

-- 
To view, visit https://gerrit.wikimedia.org/r/318695
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I561899446235165fb77b626b55f35ce716d798c9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Glaisher <glaisher.w...@gmail.com>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to