Thcipriani has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/336908 )
Change subject: Fix remaining undefined index notices
......................................................................
Fix remaining undefined index notices
Since the removal of error supression the notices from of undefined
indecies in this skin have been many. This should continue the work done
previously to squelch remaining undefined indicies.
Bug: T157619
Change-Id: I9d098389285d8a8d7927e6bbfb2e0b42844a7dd1
---
M SkinCologneBlue.php
1 file changed, 78 insertions(+), 30 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/CologneBlue
refs/changes/08/336908/1
diff --git a/SkinCologneBlue.php b/SkinCologneBlue.php
index ece6172..b00c4d8 100644
--- a/SkinCologneBlue.php
+++ b/SkinCologneBlue.php
@@ -168,23 +168,38 @@
$element = array();
$editLinkMessage =
$this->getSkin()->getTitle()->exists() ? 'editthispage' : 'create-this-page';
- $element[] = $this->processBottomLink( 'edit',
$content_nav['views']['edit'], $editLinkMessage );
- $element[] = $this->processBottomLink(
- 'viewsource',
- $content_nav['views']['viewsource'],
- 'viewsource'
- );
- $element[] = $this->processBottomLink(
- 'watch',
- $content_nav['actions']['watch'],
- 'watchthispage'
- );
- $element[] = $this->processBottomLink(
- 'unwatch',
- $content_nav['actions']['unwatch'],
- 'unwatchthispage'
- );
+ if ( isset( $content_nav['views']['edit'] ) ) {
+ $element[] = $this->processBottomLink(
+ 'edit',
+ $content_nav['views']['edit'],
+ $editLinkMessage
+ );
+ }
+
+ if ( isset( $content_nav['views']['viewsource'] ) ) {
+ $element[] = $this->processBottomLink(
+ 'viewsource',
+ $content_nav['views']['viewsource'],
+ 'viewsource'
+ );
+ }
+
+ if ( isset( $content_nav['actions']['watch'] ) ) {
+ $element[] = $this->processBottomLink(
+ 'watch',
+ $content_nav['actions']['watch'],
+ 'watchthispage'
+ );
+ }
+
+ if ( isset( $content_nav['actions']['unwatch'] ) ) {
+ $element[] = $this->processBottomLink(
+ 'unwatch',
+ $content_nav['actions']['unwatch'],
+ 'unwatchthispage'
+ );
+ }
$element[] = $this->talkLink();
@@ -193,7 +208,10 @@
$element[] = $this->processBottomLink( 'whatlinkshere',
$toolbox['whatlinkshere'] );
$element[] = $this->processBottomLink(
'recentchangeslinked', $toolbox['recentchangeslinked'] );
- $element[] = $this->processBottomLink( 'contributions',
$toolbox['contributions'] );
+ if ( isset( $toolbox['contributions'] ) ) {
+ $element[] = $this->processBottomLink(
'contributions', $toolbox['contributions'] );
+ }
+
if ( isset( $toolbox['emailuser'] ) ) {
$element[] = $this->processBottomLink(
'emailuser', $toolbox['emailuser'] );
}
@@ -203,11 +221,14 @@
// Second row. Privileged actions.
$element = array();
- $element[] = $this->processBottomLink(
- 'delete',
- $content_nav['actions']['delete'],
- 'deletethispage'
- );
+ if ( isset( $content_nav['actions']['delete'] ) ) {
+ $element[] = $this->processBottomLink(
+ 'delete',
+ $content_nav['actions']['delete'],
+ 'deletethispage'
+ );
+ }
+
if ( isset( $content_nav['actions']['undelete'] ) ) {
$element[] = $this->processBottomLink(
'undelete',
@@ -232,7 +253,13 @@
);
}
- $element[] = $this->processBottomLink( 'move',
$content_nav['actions']['move'], 'movethispage' );
+ if ( isset( $content_nav['actions']['move'] ) ) {
+ $element[] = $this->processBottomLink(
+ 'move',
+ $content_nav['actions']['move'],
+ 'movethispage'
+ );
+ }
$lines[] = $this->getSkin()->getLanguage()->pipeList(
array_filter( $element ) );
@@ -485,20 +512,38 @@
// $...['namespaces']['talk'] together serve the same purpose.
We also
// don't use $...['variants'], these are displayed in the top
menu.
$content_navigation = $this->data['content_navigation'];
+
+ $content_navigation_overrides = array();
+
+ foreach (
+ array(
+ 'views' => 'history',
+ 'actions' => 'watch',
+ 'actions' => 'unwatch',
+ ) as $keyOne => $keyTwo ) {
+ if ( isset( $content_navigation[$keyOne][$keyTwo] ) ) {
+ $content_navigation_overrides[$keyTwo] =
$content_navigation[$keyOne][$keyTwo];
+ } else {
+ $content_navigation_overrides[$keyTwo] = null;
+ }
+ }
+
$qbpageoptions = array_merge(
$content_navigation['namespaces'],
- array(
- 'history' =>
$content_navigation['views']['history'],
- 'watch' =>
$content_navigation['actions']['watch'],
- 'unwatch' =>
$content_navigation['actions']['unwatch'],
- )
+ $content_navigation_overrides
);
+
$content_navigation['actions']['watch'] = null;
$content_navigation['actions']['unwatch'] = null;
- $qbEditLinks = [ 'edit' => $content_navigation['views']['edit']
];
+
+ if ( isset( $content_navigation['views']['edit'] ) ) {
+ $qbEditLinks = [ 'edit' =>
$content_navigation['views']['edit'] ];
+ }
+
if ( isset( $content_navigation['views']['addsection'] ) ) {
$qbEditLinks['addsection'] =
$content_navigation['views']['addsection'];
}
+
$qbedit = array_merge(
$qbEditLinks,
$content_navigation['actions']
@@ -583,7 +628,10 @@
$heading = (string)$heading;
$portletId = Sanitizer::escapeId( "p-$heading" );
- $headingMsg = wfMessage( $idToMessage[$heading] ?
$idToMessage[$heading] : $heading );
+ $headingMsg = $heading;
+ if ( isset( $idToMessage[$heading] ) ) {
+ $headingMsg = wfMessage( $idToMessage[$heading]
? $idToMessage[$heading] : $heading );
+ }
$headingHTML = "<h3>";
$headingHTML .= $headingMsg->exists()
? $headingMsg->escaped()
--
To view, visit https://gerrit.wikimedia.org/r/336908
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d098389285d8a8d7927e6bbfb2e0b42844a7dd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/CologneBlue
Gerrit-Branch: master
Gerrit-Owner: Thcipriani <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits