r74915 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74914‎ | r74915 | r74916 >
Date:19:43, 17 October 2010
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: fix page title bug -- page title shouldn't be <addrelationship> or <removerelationship>, it should be whatever we set it to. Thanks to Nicmavr for reporting this bug.
Modified paths:
  • /trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserRelationship/SpecialRemoveRelationship.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php
@@ -29,7 +29,11 @@
3030 public function execute( $params ) {
3131 global $wgUser, $wgOut, $wgRequest, $wgUploadPath, $wgUserRelationshipScripts;
3232
33 - $this->setHeaders();
 33+ // Can't use $this->setHeaders(); here because then it'll set the page
 34+ // title to <removerelationship> and we don't want that, we'll be
 35+ // messing with the page title later on in the code
 36+ $wgOut->setArticleRelated( false );
 37+ $wgOut->setRobotPolicy( 'noindex,nofollow' );
3438
3539 $wgOut->addExtensionStyle( $wgUserRelationshipScripts . '/UserRelationship.css' );
3640
@@ -178,10 +182,10 @@
179183 $out = '';
180184
181185 if ( $this->relationship_type == 1 ) {
182 - $out .= $wgOut->setPageTitle( wfMsg( 'ur-add-sent-title-friend', $this->user_name_to ) );
 186+ $wgOut->setPageTitle( wfMsg( 'ur-add-sent-title-friend', $this->user_name_to ) );
183187 $sent = wfMsg( 'ur-add-sent-message-friend', $this->user_name_to );
184188 } else {
185 - $out .= $wgOut->setPageTitle( wfMsg( 'ur-add-sent-title-foe', $this->user_name_to ) );
 189+ $wgOut->setPageTitle( wfMsg( 'ur-add-sent-title-foe', $this->user_name_to ) );
186190 $sent = wfMsg( 'ur-add-sent-message-foe', $this->user_name_to );
187191 }
188192
Index: trunk/extensions/SocialProfile/UserRelationship/SpecialRemoveRelationship.php
@@ -28,7 +28,11 @@
2929 public function execute( $params ) {
3030 global $wgUser, $wgOut, $wgRequest, $wgUploadPath, $wgUserRelationshipScripts;
3131
32 - $this->setHeaders();
 32+ // Can't use $this->setHeaders(); here because then it'll set the page
 33+ // title to <removerelationship> and we don't want that, we'll be
 34+ // messing with the page title later on in the code
 35+ $wgOut->setArticleRelated( false );
 36+ $wgOut->setRobotPolicy( 'noindex,nofollow' );
3337
3438 $wgOut->addExtensionStyle( $wgUserRelationshipScripts . '/UserRelationship.css' );
3539

Status & tagging log