[MediaWiki-commits] [Gerrit] mediawiki...PollNY[master]: Replaced deprecated Linker::link usages

2017-03-01 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340544 )

Change subject: Replaced deprecated Linker::link usages
..

Replaced deprecated Linker::link usages

Bug: T149346
Change-Id: Ideef519362e279aba4a8a44c62690106c2fc36b5
---
M PollPage.php
M SpecialAdminPoll.php
M SpecialViewPoll.php
3 files changed, 16 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PollNY 
refs/changes/44/340544/1

diff --git a/PollPage.php b/PollPage.php
index f65cbc7..25c0473 100644
--- a/PollPage.php
+++ b/PollPage.php
@@ -1,4 +1,5 @@
 isAllowed( 'polladmin' ) ) {
-   $adminLinks[] = Linker::link(
+   $adminLinks[] = 
MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
SpecialPage::getTitleFor( 'AdminPoll' ),
wfMessage( 'poll-admin-panel' )->text()
);
diff --git a/SpecialAdminPoll.php b/SpecialAdminPoll.php
index 76cde69..dff391a 100644
--- a/SpecialAdminPoll.php
+++ b/SpecialAdminPoll.php
@@ -5,6 +5,8 @@
  * @file
  * @ingroup Extensions
  */
+use MediaWiki\MediaWikiServices;
+
 class AdminPoll extends SpecialPage {
 
/**
@@ -248,12 +250,13 @@
$output = '';
$numofpages = $total / $perPage;
$viewPoll = SpecialPage::getTitleFor( 'ViewPoll' );
+   $linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
 
if( $numofpages > 1 ) {
$output .= '';
 
if( $page > 1 ) {
-   $output .= Linker::link(
+   $output .= $linkRenderer->makeLink(
$viewPoll,
$this->msg( 'poll-prev' )->text(),
array(),
@@ -278,7 +281,7 @@
if( $i == $page ) {
$output .= ( $i . ' ' );
} else {
-   $output .= Linker::link(
+   $output .= $linkRenderer->makeLink(
$viewPoll,
$i,
array(),
@@ -292,7 +295,7 @@
 
if( ( $total - ( $per_page * $page ) ) > 0 ) {
$output .= $this->msg( 'word-separator' 
)->plain() .
-   Linker::link(
+   $linkRenderer->makeLink(
$viewPoll,
$this->msg( 'poll-next' 
)->text(),
array(),
diff --git a/SpecialViewPoll.php b/SpecialViewPoll.php
index a4ea6cf..b557616 100644
--- a/SpecialViewPoll.php
+++ b/SpecialViewPoll.php
@@ -4,6 +4,8 @@
  * @file
  * @ingroup Extensions
  */
+use MediaWiki\MediaWikiServices;
+
 class ViewPoll extends SpecialPage {
 
/**
@@ -22,6 +24,7 @@
$out = $this->getOutput();
$request = $this->getRequest();
$thisTitle = $this->getPageTitle();
+   $linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
 
// Add CSS & JS
$out->addModuleStyles( 'ext.pollNY.css' );
@@ -78,7 +81,7 @@
}
 
if ( $type == 'newest' ) {
-   $output .= '' . Linker::link(
+   $output .= '' . $linkRenderer->makeLink(
$thisTitle,
$this->msg( 'poll-view-popular' )->text(),
array(),
@@ -87,7 +90,7 @@
$this->msg( 'poll-view-newest' )->text() . 
'';
} else {
$output .= '' . $this->msg( 'poll-view-popular' 
)->text() .
-   '' . Linker::link(
+   '' . $linkRenderer->makeLink(
$thisTitle,
$this->msg( 'poll-view-newest' 
)->text(),
array(),
@@ -191,7 +194,7 @@
if( $numofpages > 1 ) {
$output .= '';
if( $page > 1 ) {
-   $output .= Linker::link(
+   $output .= $linkRenderer->makeLink(
$thisTitle,
$this->msg( 'poll-prev' )->text(),
array(),
@@ -216,7 +219,7 @@
if( $i == $page ) {
   

[MediaWiki-commits] [Gerrit] mediawiki...PollNY[master]: Converted alerts, and confirms to OOJSUI

2017-02-27 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340168 )

Change subject: Converted alerts, and confirms to OOJSUI
..

Converted alerts, and confirms to OOJSUI

T34950 will need a little bigger refactorisation, so will implement it in parts.

Bug: T34950
Change-Id: Id0a2251836d169120fc4bf8ea69c9a91c002056d
---
M Poll.js
M extension.json
2 files changed, 71 insertions(+), 67 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PollNY 
refs/changes/68/340168/1

diff --git a/Poll.js b/Poll.js
index fc40518..ae64443 100644
--- a/Poll.js
+++ b/Poll.js
@@ -147,7 +147,7 @@
mw.config.get( 
'wgCanonicalSpecialPageName' ) == 'CreatePoll'
)
{
-   alert( mw.msg( 
'poll-createpoll-error-nomore' ) );
+   OO.ui.alert( mw.msg( 
'poll-createpoll-error-nomore' ) );
} else {
// We have run out of polls to show
// Show a lightbox prompting the user 
to create more polls
@@ -178,23 +178,24 @@
if( status == 2 ) {
msg = mw.msg( 'poll-flagged-message' );
}
-   var ask = confirm( msg );
 
-   if( ask ) {
-   jQuery.ajax({
-   type: 'POST',
-   url: mw.util.wikiScript( 'api' ),
-   data: {
-   action: 'pollny',
-   what: 'updateStatus',
-   pollID: document.getElementById( 
'poll_id' ).value,
-   status: status,
-   format: 'json'
-   }
-   } ).done( function() {
-   window.location.reload();
-   } );
-   }
+   OO.ui.confirm( msg ).done( function ( confirmed ) {
+   if ( confirmed ) {
+   jQuery.ajax({
+   type: 'POST',
+   url: mw.util.wikiScript( 'api' ),
+   data: {
+   action: 'pollny',
+   what: 'updateStatus',
+   pollID: 
document.getElementById( 'poll_id' ).value,
+   status: status,
+   format: 'json'
+   }
+   } ).done( function() {
+   window.location.reload();
+   } );
+   }
+   } );
},
 
// Embed poll stuff
@@ -273,60 +274,62 @@
 * called; this function shows the text "action complete" on a given
 * element, while toggleStatus() reloads the page
 */
-   poll_admin_status: function( id, status ) {
-   var msg;
-   if( status === 0 ) {
-   msg = mw.msg( 'poll-close-message' );
-   }
-   if( status == 1 ) {
-   msg = mw.msg( 'poll-open-message' );
-   }
-   if( status == 2 ) {
-   msg = mw.msg( 'poll-flagged-message' );
-   }
-   var ask = confirm( msg );
+poll_admin_status: function( id, status ) {
+var msg;
+if( status === 0 ) {
+msg = mw.msg( 'poll-close-message' );
+}
+if( status == 1 ) {
+msg = mw.msg( 'poll-open-message' );
+}
+if( status == 2 ) {
+msg = mw.msg( 'poll-flagged-message' );
+}
 
-   if ( ask ) {
-   jQuery.ajax({
-   type: 'POST',
-   url: mw.util.wikiScript( 'api' ),
-   data: {
-   action: 'pollny',
-   what: 'updateStatus',
-   pollID: id,
-   status: status,
-   format: 'json'
-   }
-   } ).done( function() {
-   jQuery( '#poll-' + id + '-controls' ).html( 
mw.msg( 'poll-js-action-complete' ) );
-   } );
-   }
- 

[MediaWiki-commits] [Gerrit] mediawiki...QuizGame[master]: Fixed support to MW 1.28

2017-02-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337265 )

Change subject: Fixed support to MW 1.28
..

Fixed support to MW 1.28

MW1.28 does not support OO.ui.prompt()

Bug: T155451
Change-Id: I76ffa3bbb622c7aecc95ec8c63c4601756fe3307
---
M js/QuizGame.js
1 file changed, 34 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuizGame 
refs/changes/65/337265/1

diff --git a/js/QuizGame.js b/js/QuizGame.js
index d0e4eef..d703671 100644
--- a/js/QuizGame.js
+++ b/js/QuizGame.js
@@ -6,6 +6,39 @@
  * @author Jack Phoenix 
  * @date 8 October 2014
  */
+
+ /*
+   * That needs to be removed, when we drop support to MW 1.28. Modified 
copy pasta from OOjsUI windows.js
+   * @see https://gerrit.wikimedia.org/r/#/c/336008/
+   */
+reasonPrompt = function ( text, options ) {
+   manager = new OO.ui.WindowManager();
+   textInput = new OO.ui.TextInputWidget( ( options && options.textInput ) 
|| {} );
+   textField = new OO.ui.FieldLayout( textInput, {
+   align: 'top',
+   label: text
+   } );
+   $( 'body' ).append( manager.$element );
+   manager.addWindows( [ new OO.ui.MessageDialog() ] );
+
+   // TODO: This is a little hacky, and could be done by extending 
MessageDialog instead.
+
+   return manager.openWindow( 'message', $.extend( {
+   message: textField.$element
+   }, options ) ).then( function ( opened ) {
+   // After ready
+   textInput.on( 'enter', function () {
+   manager.getCurrentWindow().close( { action: 'accept' } 
);
+   } );
+   textInput.focus();
+   return opened.then( function ( closing ) {
+   return closing.then( function ( data ) {
+   return $.Deferred().resolve( data && 
data.action === 'accept' ? textInput.getValue() : null );
+   } );
+   } );
+   } );
+};
+
 window.QuizGame = {
continue_timer: '', // has to have an initial value...
voted: 0,
@@ -237,7 +270,7 @@
],
textInput: { placeholder: mw.msg( 
'quizgame-flagged-reason' ) }
};
-   OO.ui.prompt( mw.msg( 'quizgame-flag-confirm' ), options 
).done( function ( reason ) {
+   reasonPrompt( mw.msg( 'quizgame-flag-confirm' ), options 
).done( function ( reason ) {
if ( reason !== null ) {
var gameKey = document.getElementById( 
'quizGameKey' ).value;
var gameId = document.getElementById( 
'quizGameId' ).value;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76ffa3bbb622c7aecc95ec8c63c4601756fe3307
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/QuizGame
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...PictureGame[master]: Implemented flagging reason.

2017-02-04 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336008 )

Change subject: Implemented flagging reason.
..

Implemented flagging reason.

+ Fixed flag link showing to unlogged users.

Bug: T155451
Change-Id: If98f901cd3d090e9a1fd2450ad9957582b3da455
---
M PictureGameHome.body.php
M PictureGameHooks.class.php
M extension.json
M i18n/en.json
M i18n/qqq.json
M picturegame/PictureGame.js
A sql/picturegame-add-comment.sql
R sql/picturegame.sql
8 files changed, 88 insertions(+), 58 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PictureGame 
refs/changes/08/336008/1

diff --git a/PictureGameHome.body.php b/PictureGameHome.body.php
index 9978497..8f693d0 100644
--- a/PictureGameHome.body.php
+++ b/PictureGameHome.body.php
@@ -36,6 +36,8 @@
 * @param $par Mixed: parameter passed to the page or null
 */
public function execute( $par ) {
+   global $wgSupressPageTitle;
+
$out = $this->getOutput();
$request = $this->getRequest();
$user = $this->getUser();
@@ -45,7 +47,6 @@
$out->readOnlyPage();
return false;
}
-
// https://phabricator.wikimedia.org/T155405
// Throws error message when SocialProfile extension is not 
installed
if( !class_exists( 'UserStats' ) ) {
@@ -56,6 +57,8 @@
if( $user->isBlocked() ) {
throw new UserBlockedError( $user->getBlock() );
}
+
+   $wgSupressPageTitle = true;
 
// Salt as you like
$this->SALT = md5( $user->getName() );
@@ -235,7 +238,7 @@
$dbw = wfGetDB( DB_MASTER );
$dbw->update(
'picturegame_images',
-   array( 'flag' => PictureGameHome::$FLAG_NONE ),
+   array( 'flag' => PictureGameHome::$FLAG_NONE, 'comment' 
=> '' ),
array( 'id' => $id ),
__METHOD__
);
@@ -345,7 +348,7 @@
 
$output = '';
 
-   $out->addModuleStyles( 'ext.pictureGame.editPanel' );
+   $out->addModules( 'ext.pictureGame.editPanel' );
 
$out->setPageTitle( $this->msg( 
'picturegame-editgame-editing-title', $title_text )->text() );
 
@@ -480,7 +483,7 @@
var __admin_panel_key__ = "' . $key . '";
';
 
-   $out->addModuleStyles( 'ext.pictureGame.adminPanel' );
+   $out->addModules( 'ext.pictureGame.adminPanel' );
 
$out->setPageTitle( $this->msg( 'picturegame-adminpaneltitle' 
)->text() );
$output .= '
@@ -495,7 +498,7 @@
$dbw = wfGetDB( DB_MASTER );
$res = $dbw->select(
'picturegame_images',
-   array( 'id', 'img1', 'img2' ),
+   array( 'id', 'img1', 'img2', 'comment' ),
array(
'flag' => PictureGameHome::$FLAG_FLAGGED,
"img1 <> ''",
@@ -527,6 +530,12 @@
$img_one_description = $lang->truncate( $row->img1, 12 
);
$img_two_description = $lang->truncate( $row->img2, 12 
);
 
+   if( $row->comment != '' ) {
+   $reason = "id}\">
+   " . $this->msg( 
'picturegame-adminpanelreason' )->text() . ": {$row->comment}
+   ";
+   }
+
$output .= '
 

@@ -543,11 +552,12 @@
" |
img1}\" 
data-row-img2=\"{$row->img2}\">"
. $this->msg( 
'picturegame-adminpaneldelete' )->text() .
-   '
+   "
+   {$reason}

-   
+   
 
-   ';
+   ";
}
 
$output .= '
@@ -626,7 +636,7 @@
 
$id = $request->getInt( 'id' );
$key = $request->getVal( 'key' );
-
+   $comment = $request->getVal( 'comment' ) ?  $request->getVal( 
'comment' ) : ''; // reason for flagging
if( $key != md5( $id . $this->SALT ) ) {
echo $this->msg( 'picturegame-sysmsg-badkey' )->plain();
return;
@@ -635,7 +645,7 @@
$dbw = wfGetDB( DB_MASTER );
$dbw->update(
'picturegame_images',
-   

[MediaWiki-commits] [Gerrit] mediawiki...QuizGame[master]: Fix fatal typo in QuizGame.js

2017-01-31 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335260 )

Change subject: Fix fatal typo in QuizGame.js
..

Fix fatal typo in QuizGame.js

This typo prevent reason feature to work.

Bug: T156833
Change-Id: If7f03bba8e930be46e68c2819f80e489e2d306ec
---
M js/QuizGame.js
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuizGame 
refs/changes/60/335260/1

diff --git a/js/QuizGame.js b/js/QuizGame.js
index 1fbc2d0..d0e4eef 100644
--- a/js/QuizGame.js
+++ b/js/QuizGame.js
@@ -248,12 +248,10 @@
quizaction: 'flagItem',
key: gameKey,
id: gameId,
-   reason: reason
+   comment: reason
},
function( data ) {
document.getElementById( 
'ajax-messages' ).innerHTML = data.quizgame.output;
-   document.getElementById( 
'flag-comment' ).style.display = 'none';
-   document.getElementById( 
'flag-comment' ).style.visibility = 'hidden';
}
);
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If7f03bba8e930be46e68c2819f80e489e2d306ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/QuizGame
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...QuizGame[master]: Converted old reason field, to OOjsUI dialog.

2017-01-26 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334378 )

Change subject: Converted old reason field, to OOjsUI dialog.
..

Converted old reason field, to OOjsUI dialog.

Bug: T156304
Change-Id: Ifbc36cf6a2042dd78560ffd2414befb909d9c1de
---
M QuestionGameHome.body.php
M extension.json
M i18n/en.json
M js/QuizGame.js
4 files changed, 40 insertions(+), 47 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuizGame 
refs/changes/78/334378/1

diff --git a/QuestionGameHome.body.php b/QuestionGameHome.body.php
index d5f78c0..8759a28 100644
--- a/QuestionGameHome.body.php
+++ b/QuestionGameHome.body.php
@@ -1258,12 +1258,8 @@
$output .= "getPageTitle()->getFullURL( 
'questionGameAction=renderPermalink' ) ) .
"=' + document.getElementById( 'quizGameId' 
).value\">" .
-   $this->msg( 'quizgame-permalink' )->text() . 
'
-
-   ' .
-   $this->msg( 
'quizgame-flagged-reason' )->text() . ": 
-   msg( 'quizgame-submit' )->text() . "\" />
-   
+   $this->msg( 'quizgame-permalink' )->text() . 
"
+   


 
diff --git a/extension.json b/extension.json
index 7fe2632..bda6243 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "QuizGame",
-   "version": "3.6",
+   "version": "3.7",
"author": [
"Aaron Wright",
"Ashish Datta",
@@ -82,7 +82,8 @@
"quizgame-create-edit-picture", "quizgame-edit",
"quizgame-ajax-nonnumeric-answer", 
"quizgame-ajax-already-answered",
"quizgame-ajax-invalid-id", 
"quizgame-delete-confirm", "quizgame-delete",
-   "quizgame-cancel", "quizgame-unflag", 
"quizgame-unflag-confirm"
+   "quizgame-cancel", "quizgame-unflag", 
"quizgame-unflag-confirm", "quizgame-flag-confirm"
+   "quizgame-flag", "quizgame-flagged-reason"
],
"dependencies": [
"ext.socialprofile.flash",
diff --git a/i18n/en.json b/i18n/en.json
index 46d9de7..a112436 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -85,6 +85,7 @@
"quizgame-chose-correct": "You chose the correct answer for the 
previous question! ($1 points)",
"quizgame-chose-incorrect": "You chose the incorrect answer for the 
previous question! (0 points)",
"quizgame-flag": "Flag",
+   "quizgame-flag-confirm": "Are you sure you want to flag this question?",
"quizgame-prev": "prev",
"quizgame-nav-next": "next",
"quizgame-answered": "Answered {{PLURAL:$1|one time|$1 times}}",
diff --git a/js/QuizGame.js b/js/QuizGame.js
index e65a053..ed96b6f 100644
--- a/js/QuizGame.js
+++ b/js/QuizGame.js
@@ -223,43 +223,43 @@
},
 
/**
-* Makes the "Reason for flagging this quiz" box visible.
-* The actual backend logic is in doFlagQuestion() (below), which gets
-* called when the user pressed the button to really submit the 
flagging.
-*/
-   flagQuestion: function() {
-   document.getElementById( 'flag-comment' ).style.display = 
'block';
-   document.getElementById( 'flag-comment' ).style.visibility = 
'visible';
-   },
-
-   /**
-* Flags a quiz question for administrator attention and temporarily
+* Shows "Flag reason" dialog, and flags a quiz question
+* for administrator attention and temporarily
 * removes it from circulation by calling the API.
-* Once done, the status is reported to the user and the
-* "reason for flagging" field is hidden again.
+* Once done, the status is reported to the user.
 */
-   doFlagQuestion: function() {
-   var gameKey = document.getElementById( 'quizGameKey' ).value;
-   var gameId = document.getElementById( 'quizGameId' ).value;
-   var reason = document.getElementById( 'flag-reason' ).value;
-   jQuery.getJSON(
-   mw.util.wikiScript( 'api' ), {
-   format: 'json',
-   action: 'quizgame',
-   quizaction: 'flagItem',
-   key: gameKey,
-   id: gameId,
-   reason: reason
-   },
-   function( data ) {
-   

[MediaWiki-commits] [Gerrit] mediawiki...PollNY[master]: Added clear error message when SocialProfile extension is no...

2017-01-24 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333964 )

Change subject: Added clear error message when SocialProfile extension is not 
installed.
..

Added clear error message when SocialProfile extension is not installed.

Bug: T155405
Change-Id: I2a756bff6a6a131275bc568dc18aab703390a472
---
M SpecialAdminPoll.php
M SpecialCreatePoll.php
M SpecialUpdatePoll.php
M i18n/en.json
M i18n/qqq.json
5 files changed, 27 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PollNY 
refs/changes/64/333964/1

diff --git a/SpecialAdminPoll.php b/SpecialAdminPoll.php
index 2182aac..c756d17 100644
--- a/SpecialAdminPoll.php
+++ b/SpecialAdminPoll.php
@@ -30,6 +30,13 @@
$request = $this->getRequest();
$user = $this->getUser();
 
+   // https://phabricator.wikimedia.org/T155405
+   // Throws error message when SocialProfile extension is not 
installed
+   if( !class_exists( 'UserStats' ) ) {
+   throw new ErrorPageError( 
'poll-error-socialprofile-title', 'poll-error-socialprofile' );
+   return;
+   }
+
// If the user doesn't have the required permission, display an 
error
if( !$user->isAllowed( 'polladmin' ) ) {
throw new PermissionsError( 'polladmin' );
@@ -306,4 +313,4 @@
protected function getGroupName() {
return 'poll';
}
-}
\ No newline at end of file
+}
diff --git a/SpecialCreatePoll.php b/SpecialCreatePoll.php
index 0445126..e5cfcd9 100644
--- a/SpecialCreatePoll.php
+++ b/SpecialCreatePoll.php
@@ -31,6 +31,13 @@
 
$wgSupressPageTitle = true;
 
+   // https://phabricator.wikimedia.org/T155405
+   // Throws error message when SocialProfile extension is not 
installed
+   if( !class_exists( 'UserStats' ) ) {
+   throw new ErrorPageError( 
'poll-error-socialprofile-title', 'poll-error-socialprofile' );
+   return;
+   }
+
// Blocked users cannot create polls
if( $user->isBlocked() ) {
throw new UserBlockedError( $user->getBlock() );
diff --git a/SpecialUpdatePoll.php b/SpecialUpdatePoll.php
index f198937..a22b98d 100644
--- a/SpecialUpdatePoll.php
+++ b/SpecialUpdatePoll.php
@@ -19,6 +19,13 @@
$request = $this->getRequest();
$user = $this->getUser();
 
+   // https://phabricator.wikimedia.org/T155405
+   // Throws error message when SocialProfile extension is not 
installed
+   if( !class_exists( 'UserStats' ) ) {
+   throw new ErrorPageError( 
'poll-error-socialprofile-title', 'poll-error-socialprofile' );
+   return;
+   }
+
// Show a message if the database is in read-only mode
if ( wfReadOnly() ) {
$out->readOnlyPage();
@@ -202,4 +209,4 @@
";
return $form;
}
-}
\ No newline at end of file
+}
diff --git a/i18n/en.json b/i18n/en.json
index f50bfd1..cd22b6b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -14,6 +14,8 @@
"poll-admin-closed": "Closed",
"poll-admin-flagged": "Flagged",
"poll-admin-open": "Open",
+   "poll-error-socialprofile": 
"[https://www.mediawiki.org/wiki/Extension:SocialProfile SocialProfile 
extension] is not installed. Please install this extension and try again.",
+   "poll-error-socialprofile-title": "SocialProfile extension is not 
installed.",
"poll-admin-panel": "Admin",
"poll-admin-status-nav": "Filter by status",
"poll-admin-title-all": "Poll admin - View all polls",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 6c37f56..4321c82 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -18,6 +18,8 @@
"poll-admin-closed": "Link title; clicking on this link shows all 
closed polls.\n{{Identical|Closed}}",
"poll-admin-flagged": "Link title; clicking on this link shows all 
flagged polls.\n{{Identical|Flagged}}",
"poll-admin-open": "Link title; clicking on this link shows all open 
polls.\n{{Identical|Open}}",
+   "poll-error-socialprofile": "Error message shown when SocialProfle 
extension is not installed.",
+   "poll-error-socialprofile-title": "Title for 
quizgame-error-socialprofile.",
"poll-admin-panel": "Title of the admin panel link; shown on all Poll: 
pages, below the box {{msg-mw|poll-submitted-by}}.\n{{Identical|Admin}}",
"poll-admin-status-nav": "Title of the right-hand navigation menu on 
[[Special:AdminPoll]].\n\nFollowed by the following link texts:\n* 
{{msg-mw|Poll-admin-viewall}}\n* {{msg-mw|Poll-admin-open}}\n* 
{{msg-mw|Poll-admin-closed}}\n* 

[MediaWiki-commits] [Gerrit] mediawiki...PictureGame[master]: Added clear error message when SocialProfile extension is no...

2017-01-23 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333724 )

Change subject: Added clear error message when SocialProfile extension is not 
installed.
..

Added clear error message when SocialProfile extension is not installed.

Bug: T155405
Change-Id: Ifc7471ad4f07769a184376256521fe4d8a24b942
---
M PictureGameHome.body.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PictureGame 
refs/changes/24/333724/1

diff --git a/PictureGameHome.body.php b/PictureGameHome.body.php
index 34e9905..e9f8031 100644
--- a/PictureGameHome.body.php
+++ b/PictureGameHome.body.php
@@ -47,6 +47,11 @@
$out->readOnlyPage();
return false;
}
+   // https://phabricator.wikimedia.org/T155405
+   // Throws error message when SocialProfile extension is not 
installed
+   if( !class_exists( 'UserStats' ) ) {
+   throw new ErrorPageError( 
'picturegame-error-socialprofile-title', 'picturegame-error-socialprofile' );
+   }
 
// Blocked through Special:Block? No access for you either!
if( $user->isBlocked() ) {
diff --git a/i18n/en.json b/i18n/en.json
index 1e65ba1..4caca6c 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,6 +13,8 @@
"picturegame-permalink": "Permalink",
"picturegame-adminpanel": "Admin Panel",
"picturegame-protectimages": "Protect Images",
+   "picturegame-error-socialprofile": 
"[https://www.mediawiki.org/wiki/Extension:SocialProfile SocialProfile 
extension] is not installed. Please install this extension and try again.",
+   "picturegame-error-socialprofile-title": "SocialProfile extension is 
not installed.",
"picturegame-createlink": "Create a Picture Game",
"picturegame-skipbutton": "Skip",
"picturegame-backbutton": "Go Back",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 37d177e..adede25 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -4,5 +4,7 @@
 },
 "picturegame-adminpanelunflag-confirm": "Confirmation message shown in the 
un-flag dialog.",
 "picturegame-confirm-cancel": "Cancel button message shown in dialogs",
-"picturegame-adminpanelunflag-confirm": "Confirmation message shown in the 
delete dialog."
+"picturegame-adminpanelunflag-confirm": "Confirmation message shown in the 
delete dialog.",
+"picturegame-error-socialprofile": "Error message shown when SocialProfle 
extension is not installed.",
+   "picturegame-error-socialprofile-title": "Title for 
quizgame-error-socialprofile."
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc7471ad4f07769a184376256521fe4d8a24b942
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PictureGame
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...QuizGame[master]: Added clear error message when SocialProfile extension is no...

2017-01-21 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/86 )

Change subject: Added clear error message when SocialProfile extension is not 
installed.
..

Added clear error message when SocialProfile extension is not installed.

Bug: T155405
Change-Id: I85e3cdb630c9cf6c13fc2611f25e9abe0fcff056
---
M QuestionGameHome.body.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuizGame 
refs/changes/86/86/1

diff --git a/QuestionGameHome.body.php b/QuestionGameHome.body.php
index 36096ea..f68e67d 100644
--- a/QuestionGameHome.body.php
+++ b/QuestionGameHome.body.php
@@ -52,6 +52,10 @@
return false;
}
 
+   if( !class_exists( 'UserStats' ) ) {
+   throw new ErrorPageError( 
'quizgame-error-socialprofile-title', 'quizgame-error-socialprofile' );
+   }
+
// Blocked through Special:Block? No access for you either!
if( $user->isBlocked() ) {
throw new UserBlockedError( $user->getBlock() );
diff --git a/i18n/en.json b/i18n/en.json
index 6ef59b9..fc4f144 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -14,6 +14,8 @@
"quizgame-unflag": "Un-flag",
"quizgame-unflag-confirm": "Are you sure you want to un-flag this quiz 
game?",
"quizgame-unprotect": "Unprotect",
+   "quizgame-error-socialprofile": "SocialProfile extension is not 
installed. Please install this extension, and try again.",
+   "quizgame-error-socialprofile-title": "SocialProfile extension is not 
installed.",
"quizgame-admin-panel-title": "Admin panel",
"quizgame-admin-back": "< Back to never ending quiz",
"quizgame-admin-flagged": "Flagged questions",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a8476b8..c9ecf41 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -11,6 +11,8 @@
 "quizgame-unflag": "Link title; un-flagging returns a flagged quiz into 
the pool of available quizzes, allowing users to play it again",
 "quizgame-unflag-confirm": "Confirmation message shown in the un-flag 
dialog",
 "quizgame-unprotect": "Link title",
+"quizgame-error-socialprofile": "Error message shown when SocialProfle 
extension is not installed.",
+   "quizgame-error-socialprofile-title": "Title for 
`quizgame-error-socialprofile`.",
 "quizgame-admin-panel-title": "Link title",
 "quizgame-admin-back": "Link title on the admin panel; clicking on this 
link takes you back to the question game from the administrative functions",
 "quizgame-admin-flagged": "Header title on the admin panel of QuizGame",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85e3cdb630c9cf6c13fc2611f25e9abe0fcff056
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/QuizGame
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added release notes for 'ContentHandler::runLegacyHooks'.

2017-01-20 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333292 )

Change subject: Added release notes for 'ContentHandler::runLegacyHooks'.
..

Added release notes for 'ContentHandler::runLegacyHooks'.

Bug: T154498
Change-Id: I37402478beaac1848feff2ed95e97bebbec5cee0
---
M RELEASE-NOTES-1.29
M images/.htaccess
M images/README
3 files changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/333292/1

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index 024a6f4..2949698 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -207,6 +207,7 @@
 * Parser::replaceUnusualEscapes() (deprecated in 1.24) was removed.
 * Article::doEditContent() was marked as deprecated, to be removed in 1.30
   or later.
+* ContentHandler::runLegacyHooks() was removed.
 
 == Compatibility ==
 
diff --git a/images/.htaccess b/images/.htaccess
old mode 100644
new mode 100755
diff --git a/images/README b/images/README
old mode 100644
new mode 100755

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I37402478beaac1848feff2ed95e97bebbec5cee0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...PictureGame[master]: Added confirmation dialogs to 'Un-flag' and 'Delete' actions...

2017-01-20 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333283 )

Change subject: Added confirmation dialogs to 'Un-flag' and 'Delete' actions in 
admin panel
..

Added confirmation dialogs to 'Un-flag' and 'Delete' actions in admin panel

+ changed unclear 'Reinstate' to 'Un-flag'

Change-Id: Ibc9957503ad7d2b7c5b2083536730ec2f2b3ea00
---
M PictureGameHome.body.php
M extension.json
M i18n/en.json
M picturegame/PictureGame.js
4 files changed, 40 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PictureGame 
refs/changes/83/333283/1

diff --git a/PictureGameHome.body.php b/PictureGameHome.body.php
index dbaa320..34e9905 100644
--- a/PictureGameHome.body.php
+++ b/PictureGameHome.body.php
@@ -537,7 +537,7 @@


" .
-   $this->msg( 
'picturegame-adminpanelreinstate' )->text() .
+   $this->msg( 
'picturegame-adminpanelunflag' )->text() .
" |
img1}\" 
data-row-img2=\"{$row->img2}\">"
. $this->msg( 
'picturegame-adminpaneldelete' )->text() .
diff --git a/extension.json b/extension.json
index ff58669..98b77c2 100644
--- a/extension.json
+++ b/extension.json
@@ -56,11 +56,16 @@
"picturegame-js-error-upload-imgone",
"picturegame-js-error-upload-imgtwo", 
"picturegame-js-editing-imgone",
"picturegame-js-editing-imgtwo", 
"picturegame-protectimgconfirm",
-   "picturegame-flagimgconfirm"
+   "picturegame-flagimgconfirm", 
"picturegame-confirm-cancel",
+   "picturegame-adminpaneldelete-confirm", 
"picturegame-adminpanelunflag-confirm",
+   "picturegame-adminpaneldelete", 
"picturegame-adminpanelunflag",
+   "picturegame-adminpaneldelete-confirm", 
"picturegame-confirm-cancel"
],
"dependencies": [
"ext.socialprofile.flash",
-   "ext.socialprofile.LightBox"
+   "ext.socialprofile.LightBox",
+   "oojs-ui-core",
+   "oojs-ui-windows"
],
"position": "bottom"
},
diff --git a/i18n/en.json b/i18n/en.json
index e2fd3e2..1e65ba1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -20,8 +20,11 @@
"picturegame-adminpaneltitle": "Picture Game Admin Panel",
"picturegame-adminpanelflagged": "Flagged Images:",
"picturegame-adminpanelprotected": "Protected Images:",
-   "picturegame-adminpanelreinstate": "Reinstate",
+   "picturegame-adminpanelunflag": "Un-flag",
+   "picturegame-adminpanelunflag-confirm": "Are you sure you want to 
un-flag this picture game?",
"picturegame-adminpaneldelete": "Delete",
+   "picturegame-adminpaneldelete-confirm": "Are you sure you want to 
delete this picture game?",
+   "picturegame-confirm-cancel": "Cancel",
"picturegame-adminpanelunprotect": "Unprotect",
"picturegame-adminpanelbacktogame": " Back to the Picture Game",
"picturegame-creategametitle": "Create a Picture Game",
diff --git a/picturegame/PictureGame.js b/picturegame/PictureGame.js
index c4d1355..f7825d3 100644
--- a/picturegame/PictureGame.js
+++ b/picturegame/PictureGame.js
@@ -447,18 +447,38 @@
 };
 
 jQuery( function() {
-   // Handle clicks on "Reinstate" links on the admin panel
+   // Handle clicks on "Un-flag" links on the admin panel
jQuery( 'div.admin-controls a.picgame-unflag-link' ).on( 'click', 
function() {
-   PictureGame.unflag( jQuery( this ).parent().parent().attr( 'id' 
) );
+   var options = {
+   actions: [
+   { label: mw.msg( 'picturegame-confirm-cancel' ) 
},
+   { label: mw.msg( 'picturegame-adminpanelunflag' 
), action: 'accept', flags: ['constructive'] }
+   ]
+   }
+   OO.ui.confirm( mw.msg( 'picturegame-adminpanelunflag-confirm' 
), options ).done( function ( confirmed ) {
+   if ( confirmed ) {
+   PictureGame.unflag( jQuery( this 
).parent().parent().attr( 'id' ) );
+   }
+   } );
} );
 
// Handle clicks on "Delete" links on the admin panel
jQuery( 'div.admin-controls a.picgame-delete-link' ).on( 'click', 
function() {
-   

[MediaWiki-commits] [Gerrit] mediawiki...QuizGame[master]: Added confirmation dialog to delete action.

2017-01-16 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332399 )

Change subject: Added confirmation dialog to delete action.
..

Added confirmation dialog to delete action.

Bug: T155324
Change-Id: I5bd74d2c22266acd1724a7d53f94096972fc657d
---
M extension.json
M i18n/en.json
M js/QuizGame.js
3 files changed, 25 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuizGame 
refs/changes/99/332399/1

diff --git a/extension.json b/extension.json
index 9ecf76e..7ffc1ed 100644
--- a/extension.json
+++ b/extension.json
@@ -81,11 +81,13 @@
"quizgame-lightbox-correct-points", 
"quizgame-lightbox-incorrect-correct",
"quizgame-create-edit-picture", "quizgame-edit",
"quizgame-ajax-nonnumeric-answer", 
"quizgame-ajax-already-answered",
-   "quizgame-ajax-invalid-id"
+   "quizgame-ajax-invalid-id", "quizgame-confirm"
],
"dependencies": [
"ext.socialprofile.flash",
-   "ext.socialprofile.LightBox"
+   "ext.socialprofile.LightBox",
+   "oojs-ui-core",
+   "oojs-ui-windows"
],
"position": "bottom"
},
diff --git a/i18n/en.json b/i18n/en.json
index c0e0fec..67c7e03 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -8,6 +8,7 @@
"quizgame-desc": "Adds an interactive [[Special:QuizGameHome|question 
game]]",
"quizgame-edit": "Edit",
"quizgame-delete": "Delete",
+   "quizgame-confirm": "Are you sure?",
"quizgame-protect": "Protect",
"quizgame-reinstate": "Re-instate",
"quizgame-unprotect": "Unprotect",
diff --git a/js/QuizGame.js b/js/QuizGame.js
index 5055584..e7f815a 100644
--- a/js/QuizGame.js
+++ b/js/QuizGame.js
@@ -166,22 +166,26 @@
},
 
deleteQuestion: function() {
-   var gameKey = document.getElementById( 'quizGameKey' ).value;
-   var gameId = document.getElementById( 'quizGameId' ).value;
-   jQuery.getJSON(
-   mw.util.wikiScript( 'api' ), {
-   format: 'json',
-   action: 'quizgame',
-   quizaction: 'deleteItem',
-   key: gameKey,
-   id: gameId
-   },
-   function( data ) {
-   document.getElementById( 'ajax-messages' 
).innerHTML = data.quizgame.output + '' + mw.msg( 'quizgame-js-reloading' 
);
-   document.location = mw.config.get( 
'wgScriptPath' ) +
-   
'/index.php?title=Special:QuizGameHome=launchGame';
+   OO.ui.confirm( mw.msg( 'quizgame-confirm' ) ).done( function ( 
confirmed ) {
+   if ( confirmed ) {
+   var gameKey = document.getElementById( 
'quizGameKey' ).value;
+   var gameId = document.getElementById( 
'quizGameId' ).value;
+   jQuery.getJSON(
+   mw.util.wikiScript( 'api' ), {
+   format: 'json',
+   action: 'quizgame',
+   quizaction: 'deleteItem',
+   key: gameKey,
+   id: gameId
+   },
+   function( data ) {
+   document.getElementById( 
'ajax-messages' ).innerHTML = data.quizgame.output + '' + mw.msg( 
'quizgame-js-reloading' );
+   document.location = 
mw.config.get( 'wgScriptPath' ) +
+   
'/index.php?title=Special:QuizGameHome=launchGame';
+   }
+   );
}
-   );
+   } );
},
 
showEditMenu: function() {
@@ -756,4 +760,4 @@
} );
} );
}
-} );
\ No newline at end of file
+} );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bd74d2c22266acd1724a7d53f94096972fc657d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/QuizGame
Gerrit-Branch: master
Gerrit-Owner: Filip 


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Restricted Newsletter editing to "newsletter-manage" group.

2017-01-16 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332366 )

Change subject: Restricted Newsletter editing to "newsletter-manage" group.
..

Restricted Newsletter editing to "newsletter-manage" group.

Bug: T154384
Change-Id: I921e4c8c69a737bc8d7eac27cadf90d5f6c7aa6e
---
M extension.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/66/332366/1

diff --git a/extension.json b/extension.json
index 980a0e7..df7050e 100644
--- a/extension.json
+++ b/extension.json
@@ -163,7 +163,7 @@
"id": 5500,
"constant": "NS_NEWSLETTER",
"name": "Newsletter",
-   "protection": "newsletter-create",
+   "protection": "newsletter-manage",
"defaultcontentmodel": "NewsletterContent"
},
{

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I921e4c8c69a737bc8d7eac27cadf90d5f6c7aa6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Removed deprecated ContentHandler hooks.

2017-01-15 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332150 )

Change subject: Removed deprecated ContentHandler hooks.
..

Removed deprecated ContentHandler hooks.

Bug: T154498
Change-Id: Ie398fd4e06d3e286fe8e24112d0c8b4ac7d883dc
---
M RELEASE-NOTES-1.29
M docs/contenthandler.txt
M docs/hooks.txt
M includes/EditPage.php
M includes/Title.php
M includes/content/ContentHandler.php
M includes/page/Article.php
M includes/page/WikiPage.php
8 files changed, 11 insertions(+), 182 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/50/332150/1

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index fac6f7e..016cc62 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -184,6 +184,15 @@
 RewriteEngine On
 RewriteBase /
 RewriteRule ^/w/wiki\.phtml$ /w/index.php [R=301,L]
+* ArticleAfterFetchContent was removed. Use ArticleAfterFetchContentObject 
instead.
+* ArticleInsertComplete was removed. Use PageContentInsertComplete instead.
+* ArticleSave was removed. Use PageContentSave instead.
+* ArticleSaveComplete was removed. Use PageContentSaveComplete instead.
+* ArticleViewCustom was removed. Use ArticleContentViewCustom instead.
+* EditFilterMerged was removed. Use EditFilterMergedContent instead.
+* EditPageGetPreviewText was removed. Use EditPageGetPreviewContent instead.
+* TitleIsCssOrJsPage was removed. Use ContentHandlerDefaultModelFor instead.
+* TitleIsWikitextPage was removed. Use ContentHandlerDefaultModelFor instead.
 
 == Compatibility ==
 
diff --git a/docs/contenthandler.txt b/docs/contenthandler.txt
index 6209b14..5f379e7 100644
--- a/docs/contenthandler.txt
+++ b/docs/contenthandler.txt
@@ -21,10 +21,6 @@
 * The hook ContentHandlerDefaultModelFor may be used to override the page's 
default model.
 * Pages in NS_MEDIAWIKI and NS_USER default to the CSS or JavaScript model if 
they end in .css or .js, respectively.
   Pages in NS_MEDIAWIKI default to the wikitext model otherwise.
-* The hook TitleIsCssOrJsPage may be used to force a page to use the CSS or 
JavaScript model.
-  This is a compatibility feature. The ContentHandlerDefaultModelFor hook 
should be used instead if possible.
-* The hook TitleIsWikitextPage may be used to force a page to use the wikitext 
model.
-  This is a compatibility feature. The ContentHandlerDefaultModelFor hook 
should be used instead if possible.
 * Otherwise, the wikitext model is used.
 
 Note that is currently no mechanism to convert a page from one content model 
to another, and there is no guarantee that
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 1da39cf..8360265 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -603,12 +603,6 @@
   AND in the final query)
 $logTypes: Array of log types being queried
 
-'ArticleAfterFetchContent': DEPRECATED! Use ArticleAfterFetchContentObject
-instead.
-After fetching content of an article from the database.
-&$article: the article (object) being loaded from the database
-&$content: the content (string) of the article
-
 'ArticleAfterFetchContentObject': After fetching content of an article from the
 database.
 &$article: the article (object) being loaded from the database
@@ -677,18 +671,6 @@
 &$article: Article (object) that will be returned
 $context: IContextSource (object)
 
-'ArticleInsertComplete': DEPRECATED! Use PageContentInsertComplete.
-After a new article is created.
-$wikiPage: WikiPage created
-$user: User creating the article
-$text: New content
-$summary: Edit summary/comment
-$isMinor: Whether or not the edit was marked as minor
-$isWatch: (No longer used)
-$section: (No longer used)
-$flags: Flags passed to WikiPage::doEditContent()
-$revision: New Revision of the article
-
 'ArticleMergeComplete': After merging to article using Special:Mergehistory.
 $targetTitle: target title (object)
 $destTitle: destination title (object)
@@ -739,31 +721,6 @@
 $user: the user who did the rollback
 $revision: the revision the page was reverted back to
 $current: the reverted revision
-
-'ArticleSave': DEPRECATED! Use PageContentSave instead.
-Before an article is saved.
-$wikiPage: the WikiPage (object) being saved
-$user: the user (object) saving the article
-$text: the new article text
-$summary: the article summary (comment)
-$isminor: minor flag
-$iswatch: watch flag
-$section: section #
-
-'ArticleSaveComplete': DEPRECATED! Use PageContentSaveComplete instead.
-After an article has been updated.
-$wikiPage: WikiPage modified
-$user: User performing the modification
-$text: New content
-$summary: Edit summary/comment
-$isMinor: Whether or not the edit was marked as minor
-$isWatch: (No longer used)
-$section: (No longer used)
-$flags: Flags passed to WikiPage::doEditContent()
-$revision: New Revision of the article
-$status: Status object about to be returned by doEditContent()
-$baseRevId: the rev ID (or false) this edit was based on
-$undidRevId: the rev ID 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added "autoHideSeconds" setting in mw.notify()

2017-01-13 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331989 )

Change subject: Added "autoHideSeconds" setting in mw.notify()
..

Added "autoHideSeconds" setting in mw.notify()

Bug: T155228
Change-Id: If0d141b67515546f1605f24c2f4a50a05d5f2ba4
---
M resources/src/mediawiki/mediawiki.notification.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/331989/1

diff --git a/resources/src/mediawiki/mediawiki.notification.js 
b/resources/src/mediawiki/mediawiki.notification.js
index e1287db..e6a1c3f 100644
--- a/resources/src/mediawiki/mediawiki.notification.js
+++ b/resources/src/mediawiki/mediawiki.notification.js
@@ -350,7 +350,7 @@
notify: function ( message, options ) {
var notif;
options = $.extend( {}, notification.defaults, options 
);
-
+   this.autoHideSeconds = options.autoHideSeconds;
notif = new Notification( message, options );
 
if ( isPageReady ) {
@@ -370,6 +370,9 @@
 *   A boolean indicating whether the notifification should 
automatically
 *   be hidden after shown. Or if it should persist.
 *
+* - autoHideSeconds:
+*   Number of seconds to wait before auto-hiding notifications.
+*
 * - tag:
 *   An optional string. When a notification is tagged only one 
message
 *   with that tag will be displayed. Trying to display a new 
notification
@@ -387,6 +390,7 @@
 */
defaults: {
autoHide: true,
+   autoHideSeconds: 5,
tag: false,
title: undefined,
type: false

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0d141b67515546f1605f24c2f4a50a05d5f2ba4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...citoid[master]: Added "null" check to "addPubMedIndentifiers"

2017-01-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331879 )

Change subject: Added "null" check to "addPubMedIndentifiers"
..

Added "null" check to "addPubMedIndentifiers"

Bug: T149513
Change-Id: I7695e65efb7019ab4f161d258e50c49f9c792bd8
---
M lib/Exporter.js
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid 
refs/changes/79/331879/1

diff --git a/lib/Exporter.js b/lib/Exporter.js
index 895e263..ab7cb88 100644
--- a/lib/Exporter.js
+++ b/lib/Exporter.js
@@ -284,7 +284,10 @@
 //could add them all, but let's not do this in case of conflicting 
fields
 var keyValue = extraFields[f].split(': ');
 if (keyValue[0] === 'PMID' || keyValue[0] === 'PMCID') {
-citation[keyValue[0]] = keyValue[1].trim().replace('PMC','');
+var Id = keyValue[1].trim().replace('PMC','');
+if ( Id !== 'null' ) {
+  citation[keyValue[0]] = Id;
+}
 }
 }
 }
@@ -599,4 +602,4 @@
 module.exports.fixURL = fixURL;
 
 module.exports.validateISSN = validateISSN;
-module.exports.validateISBN = validateISBN;
\ No newline at end of file
+module.exports.validateISBN = validateISBN;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7695e65efb7019ab4f161d258e50c49f9c792bd8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/citoid
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Whitelisted DatGuy / datguysteam@gmail\.com

2017-01-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331641 )

Change subject: Whitelisted DatGuy / datguysteam@gmail\.com
..

Whitelisted DatGuy / datguysteam@gmail\.com

Change-Id: Id1c644a9b41ca71c3fe56ec2420263f77a7e5584
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/41/331641/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 73352ff..85075be 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -77,6 +77,7 @@
 | loic@dachary\.org
 | daniel@nadir-seen-fire\.com
 | daniel\.rey\.lopez@gmail\.com
+| datguysteam@gmail\.com
 | david@troi\.org
 | d_entous@yahoo\.com
 | dereckson@espace-win\.org

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1c644a9b41ca71c3fe56ec2420263f77a7e5584
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Improved parsing in reason suggests

2017-01-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331628 )

Change subject: Improved parsing in reason suggests
..

Improved parsing in reason suggests

Bug: T155086
Change-Id: I3a3167b7bfd9b5921df1cf3e4a3cf3e1da4ca001
---
M includes/ProtectionForm.php
M includes/Xml.php
M includes/page/Article.php
M includes/specials/SpecialBlock.php
M resources/src/mediawiki/mediawiki.reasonSuggest.js
5 files changed, 38 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/331628/1

diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php
index 58a04a1..b8eaa64 100644
--- a/includes/ProtectionForm.php
+++ b/includes/ProtectionForm.php
@@ -184,9 +184,10 @@
 
$out = $this->mContext->getOutput();
if ( !wfMessage( 'protect-dropdown' 
)->inContentLanguage()->isDisabled() ) {
+   $reasonsList =  Xml::dropdownToArray( wfMessage( 
'protect-dropdown' )->inContentLanguage()->text() );
$out->addModules( 'mediawiki.reasonSuggest' );
$out->addJsConfigVars( [
-   'reasons' => 'protect-dropdown'
+   'reasons' => $reasonsList
] );
}
 
diff --git a/includes/Xml.php b/includes/Xml.php
index e124c38..8dc6de6 100644
--- a/includes/Xml.php
+++ b/includes/Xml.php
@@ -564,6 +564,36 @@
}
 
/**
+* Converts textual drop-down list to array
+*
+* @param string $list Correctly formatted text (newline delimited) to 
be
+*   used to generate the options.
+* @return Array
+*/
+   public static function dropdownToArray( $list = '' ) {
+   $options = [];
+
+   foreach ( explode( "\n", $list ) as $option ) {
+   $value = trim( $option );
+   if ( $value == '' ) {
+   continue;
+   } elseif ( substr( $value, 0, 1 ) == '*' && substr( 
$value, 1, 1 ) != '*' ) {
+   // A new group is starting ...
+   $value = trim( substr( $value, 1 ) );
+   array_push( $options, $value );
+   } elseif ( substr( $value, 0, 2 ) == '**' ) {
+   // groupmember
+   $value = trim( substr( $value, 2 ) );
+   array_push( $options, $value );
+   } else {
+   // groupless reason list
+   array_push( $options, $value );
+   }
+   }
+   return $options;
+   }
+
+   /**
 * Shortcut for creating fieldsets.
 *
 * @param string|bool $legend Legend of the fieldset. If evaluates to 
false,
diff --git a/includes/page/Article.php b/includes/page/Article.php
index d268e61..502436a 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1674,9 +1674,10 @@
$ctx = $this->getContext();
$outputPage = $ctx->getOutput();
if ( !wfMessage( 'deletereason-dropdown' 
)->inContentLanguage()->isDisabled() ) {
+   $reasonsList =  Xml::dropdownToArray( wfMessage( 
'deletereason-dropdown' )->inContentLanguage()->text() );
$outputPage->addModules( 'mediawiki.reasonSuggest' );
$outputPage->addJsConfigVars( [
-   'reasons' => 'deletereason-dropdown'
+   'reasons' => $reasonsList
] );
}
$useMediaWikiUIEverywhere = $ctx->getConfig()->get( 
'UseMediaWikiUIEverywhere' );
@@ -1693,7 +1694,6 @@
Hooks::run( 'ArticleConfirmDelete', [ $this, $outputPage, 
&$reason ] );
 
$user = $this->getContext()->getUser();
-
if ( $user->isAllowed( 'suppressrevision' ) ) {
$suppress = Html::openElement( 'div', [ 'id' => 
'wpDeleteSuppressRow' ] ) .
Xml::checkLabel( wfMessage( 
'revdelete-suppress' )->text(),
@@ -1703,7 +1703,6 @@
$suppress = '';
}
$checkWatch = $user->getBoolOption( 'watchdeletion' ) || 
$user->isWatched( $title );
-
$form = Html::openElement( 'form', [ 'method' => 'post',
'action' => $title->getLocalURL( 'action=delete' ), 
'id' => 'deleteconfirm' ] ) .
Html::openElement( 'fieldset', [ 'id' => 
'mw-delete-table' ] ) .
diff --git a/includes/specials/SpecialBlock.php 
b/includes/specials/SpecialBlock.php
index 730d941..ed7a667 100644
--- a/includes/specials/SpecialBlock.php
+++ 

[MediaWiki-commits] [Gerrit] mediawiki...SemanticMediaWiki[1.8.x]: Removed depreacated function usages.

2017-01-10 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331514 )

Change subject: Removed depreacated function usages.
..

Removed depreacated function usages.

Bug: T147924
Change-Id: I2bdceb203025c140dc2f50e09b8461475a5e0fae
---
M includes/jobs/SMW_UpdateJob.php
M includes/queryprinters/SMW_QP_Feed.php
2 files changed, 11 insertions(+), 14 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki 
refs/changes/14/331514/1

diff --git a/includes/jobs/SMW_UpdateJob.php b/includes/jobs/SMW_UpdateJob.php
index 361732e..7c3d0ba 100644
--- a/includes/jobs/SMW_UpdateJob.php
+++ b/includes/jobs/SMW_UpdateJob.php
@@ -56,16 +56,18 @@
 
wfProfileIn( __METHOD__ . '-parse' );
$options = new ParserOptions();
-   $output = $wgParser->parse( $revision->getText(), $this->title, 
$options, true, true, $revision->getID() );
+   $content = $revision->getContent();
+   $revText = ContentHandler::getContentText( $content );
+   $output = $wgParser->parse( $revText, $this->title, $options, 
true, true, $revision->getID() );
 
wfProfileOut( __METHOD__ . '-parse' );
wfProfileIn( __METHOD__ . '-update' );
 
SMWParseData::storeData( $output, $this->title, false );
-   
+
wfProfileOut( __METHOD__ . '-update' );
wfProfileOut( 'SMWUpdateJob::run (SMW)' );
-   
+
return true;
}
 
@@ -81,5 +83,5 @@
parent::insert();
}
}
-   
+
 }
diff --git a/includes/queryprinters/SMW_QP_Feed.php 
b/includes/queryprinters/SMW_QP_Feed.php
index c08aba5..b68c794 100644
--- a/includes/queryprinters/SMW_QP_Feed.php
+++ b/includes/queryprinters/SMW_QP_Feed.php
@@ -253,18 +253,13 @@
// preg_match( '/^([^.!?\s]*[\.!?\s]+){0,30}/', 
$wikiPage->getText(), $abstract );
// $text = $abstract[0] . ' ...';
} else {
-   if ( method_exists( $wikiPage, 'getContent' ) ) 
{
-   $content = $wikiPage->getContent();
+   $content = $wikiPage->getContent();
 
-   if ( $content instanceof TextContent ) {
-   $text = 
$content->getNativeData();
-   }
-   else {
-   return '';
-   }
+   if ( $content instanceof TextContent ) {
+   $text = $content->getNativeData();
}
else {
-   $text = $wikiPage->getText();
+   return '';
}
}
return $GLOBALS['wgParser']->parse( $text , 
$wikiPage->getTitle(), $parserOptions )->getText();
@@ -343,4 +338,4 @@
 
return $params;
}
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2bdceb203025c140dc2f50e09b8461475a5e0fae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: 1.8.x
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SemanticForms[master]: Removed deprecated hooks and functions usages

2017-01-10 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331509 )

Change subject: Removed deprecated hooks and functions usages
..

Removed deprecated hooks and functions usages

Bug: T147924
Change-Id: I3fbdc9b64eda2b222a95d2abd388a552078a5db3
---
M includes/SF_AutoeditAPI.php
M includes/SF_CreatePageJob.php
M includes/SF_FormUtils.php
M includes/SF_Utils.php
M specials/SF_CreateClass.php
5 files changed, 14 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/09/331509/1

diff --git a/includes/SF_AutoeditAPI.php b/includes/SF_AutoeditAPI.php
index 99e9503..e0b6d4d 100644
--- a/includes/SF_AutoeditAPI.php
+++ b/includes/SF_AutoeditAPI.php
@@ -498,7 +498,7 @@
case EditPage::AS_SUMMARY_NEEDED: // no edit summary 
given and the user has forceeditsummary set and the user is not editting in his 
own userspace or talkspace and wpIgnoreBlankSummary == false
case EditPage::AS_TEXTBOX_EMPTY: // user tried to 
create a new section without content
case EditPage::AS_MAX_ARTICLE_SIZE_EXCEEDED: // article 
is too big (> $wgMaxArticleSize), after merging in the new section
-   case EditPage::AS_END: // WikiPage::doEdit() was 
unsuccessfull
+   case EditPage::AS_END: // WikiPage::doEditContent() was 
unsuccessfull
 
throw new MWException( wfMessage( 
'sf_autoedit_fail', $this->mOptions['target'] )->parse() );
 
diff --git a/includes/SF_CreatePageJob.php b/includes/SF_CreatePageJob.php
index 5e403af..7999ef4 100644
--- a/includes/SF_CreatePageJob.php
+++ b/includes/SF_CreatePageJob.php
@@ -44,10 +44,10 @@
if( array_key_exists( 'edit_summary', $this->params ) ) {
$edit_summary = $this->params['edit_summary'];
}
-   $article->doEdit( $page_text, $edit_summary );
+   $content = ContentHandler::makeContent( $page_text, 
$this->title );
+   $article->doEditContent( $content, $edit_summary );
$wgUser = $actual_user;
 
return true;
}
 }
-
diff --git a/includes/SF_FormUtils.php b/includes/SF_FormUtils.php
index 54f4c34..7ca7b4e 100644
--- a/includes/SF_FormUtils.php
+++ b/includes/SF_FormUtils.php
@@ -305,7 +305,8 @@
if ( isset( $preloadTitle ) && $preloadTitle->userCan( 
'read' ) ) {
$rev = Revision::newFromTitle( $preloadTitle );
if ( is_object( $rev ) ) {
-   $text = $rev->getText();
+   $content = $rev->getContent();
+   $text = ContentHandler::getContentText( 
$content );
// Remove  sections and 
 tags from text
$text = StringUtils::delimiterReplace( 
'', '', '', $text );
$text = strtr( $text, array( 
'' => '', '' => '' ) );
@@ -495,7 +496,7 @@
 * Deletes the form definition associated with the given wiki page
 * from the main cache.
 *
-* Hooks: ArticlePurge, ArticleSave
+* Hooks: ArticlePurge
 *
 * @param Page $wikipage
 * @return bool
diff --git a/includes/SF_Utils.php b/includes/SF_Utils.php
index 8a215f0..a317b9e 100644
--- a/includes/SF_Utils.php
+++ b/includes/SF_Utils.php
@@ -57,20 +57,13 @@
 * Gets the text contents of a page with the passed-in Title object.
 */
public static function getPageText( $title ) {
-   if ( method_exists( 'WikiPage', 'getContent' ) ) {
-   // MW 1.21+
-   $wikiPage = new WikiPage( $title );
-   $content = $wikiPage->getContent();
+   $wikiPage = new WikiPage( $title );
+   $content = $wikiPage->getContent();
 
-   if ( $content !== null ) {
-   return $content->getNativeData();
-   } else {
-   return null;
-   }
+   if ( $content !== null ) {
+   return $content->getNativeData();
} else {
-   // MW <= 1.20
-   $article = new Article( $title );
-   return $article->getContent();
+   return null;
}
}
 
diff --git a/specials/SF_CreateClass.php b/specials/SF_CreateClass.php
index 3f8ea75..b68081c 100644
--- a/specials/SF_CreateClass.php
+++ b/specials/SF_CreateClass.php
@@ -113,16 +113,9 @@
 
$template_title = Title::makeTitleSafe( NS_TEMPLATE, 
$template_name );
$edit_summary 

[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Disabled autoHid in Newsletter's floating dialogs

2017-01-09 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331255 )

Change subject: Disabled autoHid in Newsletter's floating dialogs
..

Disabled autoHid in Newsletter's floating dialogs

Bug: T15763
Change-Id: I52b31eef749ec3d1abaebc27dcdf971a44a51410
---
M modules/ext.newsletter.newsletters.js
1 file changed, 16 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/55/331255/1

diff --git a/modules/ext.newsletter.newsletters.js 
b/modules/ext.newsletter.newsletters.js
index e70c6aa..3fb655c 100644
--- a/modules/ext.newsletter.newsletters.js
+++ b/modules/ext.newsletter.newsletters.js
@@ -74,11 +74,17 @@
.done( function ( data ) {
updateLinkAttribs( $link, 
'subscribe' );
$subscriberCount.text( 
parseInt( $subscriberCount.text() ) - 1 );
-   mw.notify( mw.msg( 
'newsletter-unsubscribe-success', data.newslettersubscribe.name ) );
+   mw.notify(
+   mw.msg( 
'newsletter-unsubscribe-success', data.newslettersubscribe.name ),
+   { autoHide: false }
+   );
} )
.fail( function () {
updateLinkAttribs( $link, 
'unsubscribe' );
-   mw.notify( mw.msg( 
'newsletter-unsubscribe-error' ), { type: 'error' } );
+   mw.notify(
+   mw.msg( 
'newsletter-unsubscribe-error' ),
+   { type: 'error', 
autoHide: false }
+   );
} );
} else {
// Not subscribed currently.
@@ -87,11 +93,17 @@
.done( function ( data ) {
updateLinkAttribs( $link, 
'unsubscribe' );
$subscriberCount.text( 
parseInt( $subscriberCount.text() ) + 1 );
-   mw.notify( mw.msg( 
'newsletter-subscribe-success', data.newslettersubscribe.name ) );
+   mw.notify(
+   mw.msg( 
'newsletter-subscribe-success', data.newslettersubscribe.name ),
+   { autoHide: false }
+   );
} )
.fail( function () {
updateLinkAttribs( $link, 
'subscribe' );
-   mw.notify( mw.msg( 
'newsletter-subscribe-error' ), { type: 'error' } );
+   mw.notify(
+   mw.msg( 
'newsletter-subscribe-error' ),
+   { type: 'error', 
autoHide: false }
+   );
} );
 
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52b31eef749ec3d1abaebc27dcdf971a44a51410
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added diffrent log-in tooltip to private wiki

2017-01-08 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331220 )

Change subject: Added diffrent log-in tooltip to private wiki
..

Added diffrent log-in tooltip to private wiki

Bug: T148006
Change-Id: I14e9a554c7e6f67bc120941199b999740886
---
M includes/skins/SkinTemplate.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/20/331220/1

diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index 575a9ac..a8bcb07 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -720,7 +720,10 @@
}
 
if ( $authManager->canAuthenticateNow() ) {
-   $personal_urls['login'] = $login_url;
+   $key = User::groupHasPermission( '*', 'read' )
+   ? 'login'
+   : 'login-private';
+   $personal_urls[$key] = $login_url;
}
}
 
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index a621f1c..4f26f34 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2676,6 +2676,7 @@
"accesskey-pt-mycontris": "y",
"accesskey-pt-anoncontribs": "y",
"accesskey-pt-login": "o",
+   "accesskey-pt-login-private": "o",
"accesskey-pt-logout": "",
"accesskey-pt-createaccount": "",
"accesskey-ca-talk": "t",
@@ -2747,6 +2748,7 @@
"tooltip-pt-mycontris": "A list of {{GENDER:|your}} contributions",
"tooltip-pt-anoncontribs": "A list of edits made from this IP address",
"tooltip-pt-login": "You are encouraged to log in; however, it is not 
mandatory",
+   "tooltip-pt-login-private": "You need to log in to use this wiki",
"tooltip-pt-logout": "Log out",
"tooltip-pt-createaccount": "You are encouraged to create an account 
and log in; however, it is not mandatory",
"tooltip-ca-talk": "Discussion about the content page",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 372a127..d480f3a 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -2861,6 +2861,7 @@
"accesskey-pt-mycontris": "{{doc-accesskey}}\nSee also:\n* 
{{msg-mw|Mycontris}}\n* {{msg-mw|Accesskey-pt-mycontris}}\n* 
{{msg-mw|Tooltip-pt-mycontris}}",
"accesskey-pt-anoncontribs": "{{doc-accesskey}}\nSee also:\n* 
{{msg-mw|Anoncontribs}}\n* {{msg-mw|Tooltip-pt-anoncontribs}}",
"accesskey-pt-login": "{{doc-accesskey}}",
+   "accesskey-pt-login-private": "{{doc-accesskey}}",
"accesskey-pt-logout": "{{doc-accesskey}}\nSee also:\n* 
{{msg-mw|Logout}}\n* {{msg-mw|Accesskey-pt-logout}}\n* 
{{msg-mw|Tooltip-pt-logout}}",
"accesskey-pt-createaccount": "{{doc-accesskey}}",
"accesskey-ca-talk": "{{doc-accesskey}}\nSee also:\n* 
{{msg-mw|Talk}}\n* {{msg-mw|Accesskey-ca-talk}}\n* {{msg-mw|Tooltip-ca-talk}}",
@@ -2932,6 +2933,7 @@
"tooltip-pt-mycontris": "Tooltip shown when hovering over the 
{{msg-mw|Mycontris}} link in your personal toolbox (upper right side).\n\nSee 
also:\n* {{msg-mw|Mycontris}}\n* {{msg-mw|Accesskey-pt-mycontris}}\n* 
{{msg-mw|Tooltip-pt-mycontris}}",
"tooltip-pt-anoncontribs": "Tooltip shown when hovering over the 
{{msg-mw|Anoncontribs}} link in your personal toolbox (upper right 
side).\n\nSee also:\n* {{msg-mw|Anoncontribs}}\n* 
{{msg-mw|Accesskey-pt-anoncontribs}}",
"tooltip-pt-login": "Tooltip shown when hovering over the link 'Log in' 
in the upper right corner show on all pages while not logged in.",
+   "tooltip-pt-login-private": "Tooltip shown when hovering over the link 
'Log in' in the upper right corner show on all pages while not logged in, and 
wiki is private.",
"tooltip-pt-logout": "Tooltip shown when hovering over the 
{{msg-mw|Logout}} link in your personal toolbox (upper right side).\n\nSee 
also:\n* {{msg-mw|Logout}}\n* {{msg-mw|Accesskey-pt-logout}}\n* 
{{msg-mw|Tooltip-pt-logout}}\n{{Identical|Log out}}",
"tooltip-pt-createaccount": "Tooltip shown when hovering over the link 
'Create account' in the upper right corner show on all pages while not logged 
in.",
"tooltip-ca-talk": "Tooltip shown when hovering over the 
{{msg-mw|Talk}} tab.\n\nA 'content page' is a page that forms part of the 
purpose of the wiki. It includes the main page and pages in the main namespace 
and any other namespaces that are included when the wiki is customised. For 
example on Wikimedia Commons 'content pages' include pages in the file and 
category namespaces. On Wikinews 'content pages' include pages in the Portal 
namespace. For a technical definition of 'content namespaces' see 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added LogExtract to Special:ContentModel

2017-01-08 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331216 )

Change subject: Added LogExtract to Special:ContentModel
..

Added LogExtract to Special:ContentModel

Bug: T154874
Change-Id: I571ea324f31935c2394dce77e31c74c3afb76358
---
M includes/specials/SpecialChangeContentModel.php
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/331216/1

diff --git a/includes/specials/SpecialChangeContentModel.php 
b/includes/specials/SpecialChangeContentModel.php
index 87276a1..fe9ef43 100644
--- a/includes/specials/SpecialChangeContentModel.php
+++ b/includes/specials/SpecialChangeContentModel.php
@@ -33,6 +33,15 @@
}
}
 
+   protected function postText() {
+   $contentModelLogPage = new LogPage( 'contentmodel' );
+   $text = Xml::element( 'h2', null, 
$contentModelLogPage->getName()->text() );
+   $out = '';
+   LogEventsList::showLogExtract( $out, 'contentmodel', 
$this->title );
+   $text .= $out;
+   return $text;
+   }
+
protected function getDisplayFormat() {
return 'ooui';
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I571ea324f31935c2394dce77e31c74c3afb76358
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Removed deprecated function 'Article::getContent()'

2017-01-07 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331118 )

Change subject: Removed deprecated function 'Article::getContent()'
..

Removed deprecated function 'Article::getContent()'

Bug: T61113
Change-Id: I2654dbb38986c094bd7c59cee74ead2a459fbdb4
---
M RELEASE-NOTES-1.29
M includes/page/Article.php
2 files changed, 1 insertion(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/331118/1

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index 3630abc..e2ff83f 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -163,6 +163,7 @@
 * Hook UnknownAction (deprecated in 1.19) was actually deprecated (it will now 
emit warnings).
   Create a subclass of Action, and add it to $wgActions instead.
 * WikiRevision:getText() (deprecated since 1.21) is no longer marked 
deprecated.
+* Article::getContent() (deprecated in 1.21) was removed. Use ContentHandler 
instead.
 
 == Compatibility ==
 
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 4bcb655..4d90f4b 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -198,24 +198,6 @@
}
 
/**
-* Note that getContent does not follow redirects anymore.
-* If you need to fetch redirectable content easily, try
-* the shortcut in WikiPage::getRedirectTarget()
-*
-* This function has side effects! Do not use this function if you
-* only want the real revision text if any.
-*
-* @deprecated since 1.21; use WikiPage::getContent() instead
-*
-* @return string Return the text of this revision
-*/
-   public function getContent() {
-   wfDeprecated( __METHOD__, '1.21' );
-   $content = $this->getContentObject();
-   return ContentHandler::getContentText( $content );
-   }
-
-   /**
 * Returns a Content object representing the pages effective display 
content,
 * not necessarily the revision's content!
 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2654dbb38986c094bd7c59cee74ead2a459fbdb4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Restrict "newsletter-create" to sysop group

2017-01-06 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330871 )

Change subject: Restrict "newsletter-create" to sysop group
..

Restrict "newsletter-create" to sysop group

Bug: T154536
Change-Id: Ic8730b81eb10d1da24c91d76077c52afc1fc905b
---
M extension.json
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/71/330871/1

diff --git a/extension.json b/extension.json
index 05fddab..980a0e7 100644
--- a/extension.json
+++ b/extension.json
@@ -16,10 +16,8 @@
"newsletter-manage"
],
"GroupPermissions": {
-   "autoconfirmed": {
-   "newsletter-create": true
-   },
"sysop": {
+   "newsletter-create": true,
"newsletter-delete": true,
"newsletter-manage": true
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8730b81eb10d1da24c91d76077c52afc1fc905b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added reason suggestion in block/delete/protect forms

2017-01-04 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330447 )

Change subject: Added reason suggestion in block/delete/protect forms
..

Added reason suggestion in block/delete/protect forms

Bug: T34950
Change-Id: I9778c4992b127c36355949665b4fdf7482e7e0e7
---
M RELEASE-NOTES-1.29
M includes/ProtectionForm.php
M includes/page/Article.php
M includes/specials/SpecialBlock.php
M resources/Resources.php
A resources/src/mediawiki/mediawiki.reasonSuggest.js
M resources/src/mediawiki/mediawiki.userSuggest.js
7 files changed, 44 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/330447/1

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index 72c82de..c1356f4 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -37,6 +37,7 @@
   dnsbls, are now indicated as such and use a new i18n message when displayed.
 * Added new $wgHTTPImportTimeout setting. Sets timeout for
   downloading the XML dump during a transwiki import in seconds.
+* Added reason suggestions for block, delete and protect forms.
 
 === External library changes in 1.29 ===
 
diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php
index 454ffcc..361485b 100644
--- a/includes/ProtectionForm.php
+++ b/includes/ProtectionForm.php
@@ -181,11 +181,15 @@
if ( MWNamespace::getRestrictionLevels( 
$this->mTitle->getNamespace() ) === [ '' ] ) {
throw new ErrorPageError( 'protect-badnamespace-title', 
'protect-badnamespace-text' );
}
-
+   $out = $this->mContext->getOutput();
+   $out->addModules( 'mediawiki.reasonSuggest' );
+   $out->addJsConfigVars([
+   'reasons' => wfMessage( 'protect-dropdown' 
)->inContentLanguage()->text()
+   ] );
if ( $this->mContext->getRequest()->wasPosted() ) {
if ( $this->save() ) {
$q = $this->mArticle->isRedirect() ? 
'redirect=no' : '';
-   $this->mContext->getOutput()->redirect( 
$this->mTitle->getFullURL( $q ) );
+   $out->redirect( $this->mTitle->getFullURL( $q ) 
);
}
} else {
$this->show();
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 4bcb655..253a086 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1673,6 +1673,10 @@
$title = $this->getTitle();
$ctx = $this->getContext();
$outputPage = $ctx->getOutput();
+   $outputPage->addModules( 'mediawiki.reasonSuggest' );
+   $outputPage->addJsConfigVars([
+   'reasons' => wfMessage( 'deletereason-dropdown' 
)->inContentLanguage()->text()
+   ] );
$useMediaWikiUIEverywhere = $ctx->getConfig()->get( 
'UseMediaWikiUIEverywhere' );
$outputPage->setPageTitle( wfMessage( 'delete-confirm', 
$title->getPrefixedText() ) );
$outputPage->addBacklinkSubtitle( $title );
@@ -1683,7 +1687,6 @@
'deleting-backlinks-warning' );
}
$outputPage->addWikiMsg( 'confirmdeletetext' );
-
Hooks::run( 'ArticleConfirmDelete', [ $this, $outputPage, 
&$reason ] );
 
$user = $this->getContext()->getUser();
diff --git a/includes/specials/SpecialBlock.php 
b/includes/specials/SpecialBlock.php
index 585f70b..fce8cfe 100644
--- a/includes/specials/SpecialBlock.php
+++ b/includes/specials/SpecialBlock.php
@@ -128,6 +128,10 @@
protected function getFormFields() {
global $wgBlockAllowsUTEdit;
 
+   $this->getOutput()->addModules( 'mediawiki.reasonSuggest' );
+   $this->getOutput()->addJsConfigVars([
+   'reasons' => wfMessage( 'ipbreason-dropdown' 
)->inContentLanguage()->text()
+   ] );
$user = $this->getUser();
 
$suggestedDurations = self::getSuggestedDurations();
diff --git a/resources/Resources.php b/resources/Resources.php
index 92013ec..f408c75 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1396,6 +1396,12 @@
],
'targets' => [ 'desktop', 'mobile' ],
],
+   'mediawiki.reasonSuggest' => [
+   'scripts' => 
'resources/src/mediawiki/mediawiki.reasonSuggest.js',
+   'dependencies' => [
+   'jquery.suggestions'
+   ]
+   ],
'mediawiki.userSuggest' => [
'scripts' => 'resources/src/mediawiki/mediawiki.userSuggest.js',
'dependencies' => [
diff --git a/resources/src/mediawiki/mediawiki.reasonSuggest.js 
b/resources/src/mediawiki/mediawiki.reasonSuggest.js
new file 

[MediaWiki-commits] [Gerrit] mediawiki...Ids[master]: Follow mediawiki guidelines

2017-01-04 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330422 )

Change subject: Follow mediawiki guidelines
..

Follow mediawiki guidelines

Bug: T154453
Change-Id: Id4a9a5cdf2d606b66a5c3dc949fb505c217c6da0
---
M ids_body.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Ids 
refs/changes/22/330422/1

diff --git a/ids_body.php b/ids_body.php
index e2e809f..514dfa2 100644
--- a/ids_body.php
+++ b/ids_body.php
@@ -27,7 +27,7 @@
 
// Support for Simplified "é«”" (font)
$font = isset ( $args['font'] ) ? strtr( $args['font'], '体', 
'體' ) : '宋體';
-   $src = $endpoint . rawurlencode($input) . '.svg?å­—é«”=' . 
rawurlencode($font);
+   $src = $endpoint . rawurlencode( $input ) . '.svg?å­—é«”=' . 
rawurlencode( $font );
 
return Html::element( 'img', [
'align' => 'middle',
@@ -36,6 +36,6 @@
'src' => $src,
'onerror' => 'this.src = this.src.replace(".svg?å­—é«”=", 
".png?å­—é«”=")',  // png fallback
'style' => 'height: 1em; width: 1em; vertical-align: 
middle; margin: 0.4em 0px 0.7em;'
-   ]);
+   ] );
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4a9a5cdf2d606b66a5c3dc949fb505c217c6da0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Ids
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Added Ids extension composer tests

2017-01-03 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330241 )

Change subject: Added Ids extension composer tests
..

Added Ids extension composer tests

Bug: T154453
Change-Id: I1595bb96ed1a4978aec9c71024ec05fd9c6ecaa5
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/41/330241/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index fc1dee9..29195a4 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -3898,6 +3898,7 @@
 
   - name: mediawiki/extensions/Ids
 template:
+  - name: composer-test
   - name: extension-unittests-generic
 check:
   - jsonlint

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1595bb96ed1a4978aec9c71024ec05fd9c6ecaa5
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Ids[master]: Introduce CI tests

2017-01-03 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330239 )

Change subject: Introduce CI tests
..

Introduce CI tests

Bug: T154453
Change-Id: I38b45fb716fe503fb41447ff57d97147dcdbdec6
---
A composer.json
M ids_body.php
A phpcs.xml
3 files changed, 42 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Ids 
refs/changes/39/330239/1

diff --git a/composer.json b/composer.json
new file mode 100644
index 000..98d41d9
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,13 @@
+{
+   "require-dev": {
+   "jakub-onderka/php-parallel-lint": "0.9.2",
+   "mediawiki/mediawiki-codesniffer": "0.7.2"
+   },
+   "scripts": {
+   "fix": "phpcbf",
+   "test": [
+   "parallel-lint . --exclude vendor",
+   "phpcs -p -s"
+   ]
+   }
+}
diff --git a/ids_body.php b/ids_body.php
index 76b5268..e6b7603 100644
--- a/ids_body.php
+++ b/ids_body.php
@@ -1,37 +1,39 @@
 
+*/
 
-// 0614-2016 change server to https://tools.wmflabs.org/idsgen/
 class IDS {
static function onParserInit( Parser $parser ) {
$parser->setHook( 'ids', [ __CLASS__, 'idsRender' ] );
return true;
}
-   /*
-* This method handles IDS tags.
-*
-* ⿰電心 ->
-*  https://tools.wmflabs.org/idsgen/⿰電心.svg?字體=宋體; ...>
-*
-* ⿰電心 ->
-*  https://tools.wmflabs.org/idsgen/⿰電心.svg?字體=楷體粗體; ...>
-*
-* @see https://www.mediawiki.org/wiki/Manual:Tag_extensions
-*/
+   /**
+   * This method handles IDS tags.
+   *
+   * ⿰電心 ->
+   *   https://tools.wmflabs.org/idsgen/⿰電心.svg?字體=宋體; ...>
+   *
+   * ⿰電心 ->
+   *   https://tools.wmflabs.org/idsgen/⿰電心.svg?字體=楷體粗體; ...>
+   *
+   * @see https://www.mediawiki.org/wiki/Manual:Tag_extensions
+   */
static function idsRender( $input, array $args, Parser $parser, PPFrame 
$frame ) {
// Support for Simplified "é«”" (font)
-   $font = isset($args['font']) ? strtr($args['font'] , '体', '體') 
: '宋體';
-   $src = 'https://tools.wmflabs.org/idsgen/' . 
rawurlencode($input) . '.svg?å­—é«”=' . rawurlencode($font);
+   $font = isset ( $args['font'] ) ? strtr( $args['font'], '体', 
'體' ) : '宋體';
+   $src = 'https://tools.wmflabs.org/idsgen/' .
+   rawurlencode( $input ) .
+   '.svg?å­—é«”=' .
+   rawurlencode( $font );
 
-   return Html::element('img', [
+   return Html::element( 'img', [
'align' => 'middle',
'class' => 'ids-char',  // helps with custom styling
'alt' => $input,
'src' => $src,
'onerror' => 'this.src = this.src.replace(".svg?å­—é«”=", 
".png?å­—é«”=")',  // png fallback
'style' => 'height: 1em; width: 1em; vertical-align: 
middle; margin: 0.4em 0px 0.7em;'
-   ]);
+   ] );
}
 }
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 000..d81a292
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,8 @@
+
+
+   
+   .
+   
+   
+   vendor
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I38b45fb716fe503fb41447ff57d97147dcdbdec6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Ids
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SemanticPageSeries[master]: Replaced deprecated 'Article::getContent' usage

2017-01-02 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330191 )

Change subject: Replaced deprecated 'Article::getContent' usage
..

Replaced deprecated 'Article::getContent' usage

Bug: T151973
Change-Id: I88b079a2f7367704578e0b0aaec684205ba2603b
---
M includes/SPSSpecialSeriesEdit.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticPageSeries 
refs/changes/91/330191/1

diff --git a/includes/SPSSpecialSeriesEdit.php 
b/includes/SPSSpecialSeriesEdit.php
index 8161404..c5a22a4 100644
--- a/includes/SPSSpecialSeriesEdit.php
+++ b/includes/SPSSpecialSeriesEdit.php
@@ -98,7 +98,8 @@
}
 
$formArticle = new Article( $formTitle );
-   $formDefinition = StringUtils::delimiterReplace( '', 
'', '', $formArticle->getContent() );
+   $formArticleText = ContentHandler::getContentText( 
$formArticle->getContentObject() );
+   $formDefinition = StringUtils::delimiterReplace( '', 
'', '', $formArticleText );
 
// formSubmitted
$formSubmitted = false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88b079a2f7367704578e0b0aaec684205ba2603b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticPageSeries
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SemanticPageMaker[master]: Replaced deprecated 'Article::getContent()' usage

2017-01-02 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330190 )

Change subject: Replaced deprecated 'Article::getContent()' usage
..

Replaced deprecated 'Article::getContent()' usage

Bug: T151973
Change-Id: Ic154bb3ce94a72faaffcfc8be38ea5bca1b30b6a
---
M includes/models/SPM_OM_Template.php
M includes/widgets/SPM_WFAjaxAccess.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticPageMaker 
refs/changes/90/330190/1

diff --git a/includes/models/SPM_OM_Template.php 
b/includes/models/SPM_OM_Template.php
index 0c5fd8a..c065a88 100644
--- a/includes/models/SPM_OM_Template.php
+++ b/includes/models/SPM_OM_Template.php
@@ -47,7 +47,7 @@
return null;
}
 
-   $text = $article->getContent();
+   $text = ContentHandler::getContentText( 
$article->getContentObject() );
$len = strlen( $text );
$offset = 0;
$content2 = '';
diff --git a/includes/widgets/SPM_WFAjaxAccess.php 
b/includes/widgets/SPM_WFAjaxAccess.php
index 56e8dcd..04f0968 100644
--- a/includes/widgets/SPM_WFAjaxAccess.php
+++ b/includes/widgets/SPM_WFAjaxAccess.php
@@ -296,7 +296,7 @@
 // $article = new Article( $tmpl_title );
 // if ( !$article->exists() ) continue;
 //
-// $text = $article->getContent();
+// $text = ContentHandler::getContentText( 
$article->getContent() );
 // $len = strlen( $text );
 // $offset = 0;
 // $content2 = '';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic154bb3ce94a72faaffcfc8be38ea5bca1b30b6a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticPageMaker
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added $wgHTTPImportTimeout setting

2017-01-02 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330171 )

Change subject: Added $wgHTTPImportTimeout setting
..

Added $wgHTTPImportTimeout setting

Bug: T17000
Change-Id: Ic97ae4faec173c32af38df4554831dca7068226b
---
M includes/DefaultSettings.php
M includes/import/ImportStreamSource.php
2 files changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/71/330171/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 3274480..e71c0d2 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -8056,6 +8056,11 @@
 $wgHTTPTimeout = 25;
 
 /**
+ * Timeout for HTTP requests done internally in imports, in seconds.
+ */
+$wgHTTPImportTimeout = 60;
+
+/**
  * Timeout for Asynchronous (background) HTTP requests, in seconds.
  */
 $wgAsyncHTTPTimeout = 25;
diff --git a/includes/import/ImportStreamSource.php 
b/includes/import/ImportStreamSource.php
index e2e8dd5..7f8d64b 100644
--- a/includes/import/ImportStreamSource.php
+++ b/includes/import/ImportStreamSource.php
@@ -29,6 +29,7 @@
  * @ingroup SpecialPage
  */
 class ImportStreamSource implements ImportSource {
+   global $wgHTTPTimeout = $wgHTTPImportTimeout;
function __construct( $handle ) {
$this->mHandle = $handle;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic97ae4faec173c32af38df4554831dca7068226b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...examples[master]: Removed deprecated 'UnknownAction' hook usage

2017-01-02 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330168 )

Change subject: Removed deprecated 'UnknownAction' hook usage
..

Removed deprecated 'UnknownAction' hook usage

Bug: T54027
Change-Id: Iaec7aa5e6fbb1c53c69da84948d8648285774a10
---
M ContentAction/ContentAction.php
M ContentAction/extension.json
M examples.php
3 files changed, 12 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/examples 
refs/changes/68/330168/1

diff --git a/ContentAction/ContentAction.php b/ContentAction/ContentAction.php
index 82aea21..99a1ba4 100644
--- a/ContentAction/ContentAction.php
+++ b/ContentAction/ContentAction.php
@@ -8,8 +8,7 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
-class ContentAction {
-
+class ContentAction extends FormlessAction {
public static function onSkinTemplateNavigation( $skin, 
&$content_actions ) {
$action = $skin->getRequest->getText( 'action' );
 
@@ -23,17 +22,14 @@
 
return true;
}
-
-   public static function onUnknownAction( $action, $article ) {
-   $title = $article->getTitle();
-
-   if ( $action === 'myact' ) {
-   $article->getContext()->getOutput()->addWikiText(
-   'The page name is ' . $title->getText() . ' and 
you are ' . $article->getUserText()
-   );
-   return false;
-   }
-
-   return true;
+   public function getName() {
+   return 'myact';
}
+
+   public function show() {
+   $this->getContext()->getOutput()->addWikiText(
+   'The page name is ' . $this->getTitle->getText() . ' 
and you are ' . $this->getUser()->getName()
+   );
+   }
+
 }
diff --git a/ContentAction/extension.json b/ContentAction/extension.json
index 47fea6c..d72c43a 100644
--- a/ContentAction/extension.json
+++ b/ContentAction/extension.json
@@ -9,7 +9,6 @@
]
},
"Hooks": {
-   "UnknownAction": "ContentAction::onUnknownAction",
"SkinTemplateNavigation": 
"ConentAction::onSkinTemplateNavigation"
},
"AutoloadClasses": {
diff --git a/examples.php b/examples.php
index 095d448..5147efc 100644
--- a/examples.php
+++ b/examples.php
@@ -6,3 +6,5 @@
 require_once __DIR__ . "/DataPages/DataPages.php";
 
 require_once __DIR__ . "/Example/Example.php";
+
+$wgActions['myact'] = ContentAction;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaec7aa5e6fbb1c53c69da84948d8648285774a10
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/examples
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fully deprecate 'ContentAction' hook

2017-01-02 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330138 )

Change subject: Fully deprecate 'ContentAction' hook
..

Fully deprecate 'ContentAction' hook

Bug: T54027
Change-Id: Ia765e25a9f76b34f7b10125d3b6e0c8e00fac2ca
---
M docs/hooks.txt
M includes/MediaWiki.php
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/330138/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index e8335cd..f7c4072 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3420,8 +3420,8 @@
 test case files matching the suffix "Test.php".
 &$paths: list of test cases and directories to search.
 
-'UnknownAction': An unknown "action" has occurred (useful for defining your own
-actions).
+'UnknownAction': DEPRECATED! To add an action in an extension, create a 
subclass of Action, and add a new key to $wgActions.
+An unknown "action" has occurred (useful for defining your own actions).
 $action: action name
 $article: article "acted on"
 
diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index eaa1c995..5f9cbff 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -496,7 +496,7 @@
return;
}
 
-   if ( Hooks::run( 'UnknownAction', [ $request->getVal( 'action', 
'view' ), $page ] ) ) {
+   if ( Hooks::run( 'UnknownAction', [ $request->getVal( 'action', 
'view' ), $page ], '1.19' ) ) {
$output->setStatusCode( 404 );
$output->showErrorPage( 'nosuchaction', 
'nosuchactiontext' );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia765e25a9f76b34f7b10125d3b6e0c8e00fac2ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Removed unnecessary logging/

2017-01-01 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330048 )

Change subject: Removed unnecessary logging/
..

Removed unnecessary logging/

Deletion and restore are unnecessary, becouse they're logged in WikiPage 
actions.

Bug: T154342
Change-Id: I3c55ecf24ecb3d503e2ae0160f4ad9bb586e56f4
---
M includes/NewsletterStore.php
M includes/logging/NewsletterLogger.php
2 files changed, 2 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/48/330048/1

diff --git a/includes/NewsletterStore.php b/includes/NewsletterStore.php
index 8e86f2c..27f81cb 100644
--- a/includes/NewsletterStore.php
+++ b/includes/NewsletterStore.php
@@ -139,11 +139,7 @@
 * @return bool success of the action
 */
public function deleteNewsletter( Newsletter $newsletter, $reason ) {
-   $success = $this->db->deleteNewsletter( $newsletter );
-   if ( $success ) {
-   $this->logger->logNewsletterDeleted( $newsletter, 
$reason );
-   }
-   return $success;
+   return $this->db->deleteNewsletter( $newsletter );
}
 
/**
@@ -154,11 +150,7 @@
 * @return bool success of the action
 */
public function restoreNewsletter( $newsletterName ) {
-   $success = $this->db->restoreNewsletter( $newsletterName );
-   if ( $success ) {
-   $this->logger->logNewsletterRestored( 
$this->db->getNewsletterFromName( $newsletterName ) );
-   }
-   return $success;
+   return $this->db->restoreNewsletter( $newsletterName );
}
 
/**
diff --git a/includes/logging/NewsletterLogger.php 
b/includes/logging/NewsletterLogger.php
index 8987cd4..14c266e 100644
--- a/includes/logging/NewsletterLogger.php
+++ b/includes/logging/NewsletterLogger.php
@@ -41,27 +41,6 @@
$log->publish( $log->insert() );
}
 
-   public function logNewsletterDeleted( Newsletter $newsletter, $reason ) 
{
-   $id = $newsletter->getId();
-   $log = new ManualLogEntry( 'newsletter', 'newsletter-removed' );
-   $log->setPerformer( RequestContext::getMain()->getUser() );
-   $log->setTarget( SpecialPage::getTitleFor( 'Newsletter', $id ) 
);
-   $log->setParameters( [ '4:newsletter-link:nl_id' => 
"$id:{$newsletter->getName()}" ] );
-   $log->setComment( $reason );
-   $log->setRelations( [ 'nl_id' => $id ] );
-   $log->publish( $log->insert() );
-   }
-
-   public function logNewsletterRestored( Newsletter $newsletter ) {
-   $id = $newsletter->getId();
-   $log = new ManualLogEntry( 'newsletter', 'newsletter-restored' 
);
-   $log->setPerformer( RequestContext::getMain()->getUser() );
-   $log->setTarget( SpecialPage::getTitleFor( 'Newsletter', $id ) 
);
-   $log->setParameters( [ '4:newsletter-link:nl_id' => 
"$id:{$newsletter->getName()}" ] );
-   $log->setRelations( [ 'nl_id' => $id ] );
-   $log->publish( $log->insert() );
-   }
-
public function logNewIssue( User $publisher, Newsletter $newsletter, 
Title $issueTitle, $issueId, $comment ) {
$log = new ManualLogEntry( 'newsletter', 'issue-added' );
$log->setPerformer( $publisher );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c55ecf24ecb3d503e2ae0160f4ad9bb586e56f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SemanticImageAnnotator[master]: Replaced deprecated "Article::doEdit("

2016-12-31 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329792 )

Change subject: Replaced deprecated "Article::doEdit("
..

Replaced deprecated "Article::doEdit("

Bug: T151973
Change-Id: I8873109e192e9786ec6a5100ff836617a0537efe
---
M SIA_AjaxFunctions.php
1 file changed, 10 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticImageAnnotator 
refs/changes/92/329792/1

diff --git a/SIA_AjaxFunctions.php b/SIA_AjaxFunctions.php
index 9a0dca7..3c96e79 100644
--- a/SIA_AjaxFunctions.php
+++ b/SIA_AjaxFunctions.php
@@ -10,8 +10,8 @@
$article->doDelete('ImageAnnotation removed');
return($annotationID);
 }
-   
-function writeAnnotationProperties($newPageName, $annotatedImage, $imageURL, 
$coords,$createdBy){
+
+function writeAnnotationProperties($newPageName, $annotatedImage, $imageURL, 
$coords, $createdBy){
$newTitle = Title::newFromText($newPageName);
$newArticle = new Article($newTitle);
$content = '';
@@ -21,7 +21,8 @@
$content .= '[[SIArectangleCoordinates::'.$coords.'| ]]'."\n";
$content .= '[[SIAcreatedBy::'.$createdBy.'| ]]'."\n";
$content .= '[[Category:ImageAnnotation]]'."\n";
-   $newArticle->doEdit($content, 'Created by Semantic Image Annotator');
+   $contentObject = ContentHandler::makeContent( $content, $newTitle );
+   $newArticle->doEditContent($contentObject, 'Created by Semantic Image 
Annotator');
return ('success');
 }
 
@@ -35,7 +36,7 @@
 $new = version_compare($vers, '1.7', '>=');
 }
 }
-
+
 $returnString = '{"shapes":[';
 $queryString = '[[SIAannotatedImage::'.$annotatedImage.']]';
 $params = array();
@@ -43,7 +44,7 @@
 $params['mainlabel'] = 'result';
 #$params = ['order'];
 #$params = ['sort'];
-
+
if($new){
 $params['order'] = array('asc');
 $params['sort'] = array('SIAannotatedImage');
@@ -52,7 +53,7 @@
 $params['order'] = 'asc';
 $params['sort'] = 'SIAannotatedImage';
 }
-
+
//Generate all the extra printouts, eg all properties to retrieve:
$printmode = SMWPrintRequest::PRINT_PROP;
$customPrintouts = array(   'coordinates'   => 
'SIArectangleCoordinates',
@@ -69,17 +70,17 @@
$query  = SMWQueryProcessor::createQuery( $queryString, $params, 
$context, $format, $extraprintouts );
$store = smwfGetStore(); // default store
$res = $store->getQueryResult( $query );
-   
+
$shapeCounter = 0;
while( ($resArrayArray = $res->getNext()) != false){//Array of 
SMWResultArray Objects, eg. all retrieved Pages
$shapeCounter++;
 
if($shapeCounter > 1) $returnString.=',';
$returnString.='{';
-   foreach($resArrayArray as $resArray){   
//SMWResultArray-Object, column of resulttable (pagename or propertyvalue)  

+   foreach($resArrayArray as $resArray){   
//SMWResultArray-Object, column of resulttable (pagename or propertyvalue)
$currentPrintRequestLabel = 
$resArray->getPrintRequest()->getLabel();   //The label as defined in the above 
array
if($currentPrintRequestLabel == 'coordinates'){
-   $currentResultPage = 
$resArray->getResultSubject(); 
+   $currentResultPage = 
$resArray->getResultSubject();
$currentID = 
$currentResultPage->getTitle()->getFullText();
$currentCoords = 
$resArray->getNextDataItem()->getSerialization();

$returnString.='"coords":"'.$currentCoords.'","id":"'.$currentID.'"';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8873109e192e9786ec6a5100ff836617a0537efe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticImageAnnotator
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SemanticComments[master]: Replaced deprecated "Article::doEdit("

2016-12-31 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329791 )

Change subject: Replaced deprecated "Article::doEdit("
..

Replaced deprecated "Article::doEdit("

Plus fixed indention

Bug: T151973
Change-Id: I8b24efa629379fa89b135dafd550d427be429939
---
M specials/Comment/CE_Comment.php
1 file changed, 113 insertions(+), 112 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticComments 
refs/changes/91/329791/1

diff --git a/specials/Comment/CE_Comment.php b/specials/Comment/CE_Comment.php
index f7044eb..9e4bf0c 100644
--- a/specials/Comment/CE_Comment.php
+++ b/specials/Comment/CE_Comment.php
@@ -1,36 +1,36 @@
 http://www.gnu.org/licenses/>.
- *
- */
+* Copyright (C) Vulcan Inc.
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program.If not, see .
+*
+*/
 
 /**
- * @file
- * @ingroup CEComment
- * 
- * This file contains the implementation of comment creation for 
SemanticComments.
- *
- * @author Benjamin Langguth
- * Date: 07.12.2009
- */
+* @file
+* @ingroup CEComment
+*
+* This file contains the implementation of comment creation for 
SemanticComments.
+*
+* @author Benjamin Langguth
+* Date: 07.12.2009
+*/
 
 /**
- * @defgroup CEComment
- * @ingroup SemanticComments
- */
+* @defgroup CEComment
+* @ingroup SemanticComments
+*/
 
 if ( !defined( 'MEDIAWIKI' ) ) {
die( "This file is part of the SemanticComments extension. It is not a 
valid entry point.\n" );
@@ -38,18 +38,18 @@
 
 
 class CEComment {
-   
+
/* constants */
const SUCCESS = 0;
const COMMENT_ALREADY_EXISTS = 1;
const PERMISSION_ERROR = 2;
-   
+
/**
-* This function creates a new comment article
-* @param string $pageName
-* @param string $pageContent
-* @param bool $editMode
-*/
+   * This function creates a new comment article
+   * @param string $pageName
+   * @param string $pageContent
+   * @param bool $editMode
+   */
public static function createComment( $pageName, $pageContent, 
$editMode = false ) {
wfProfileIn( __METHOD__ . ' [SemanticComments]' );
global $wgUser, $cegEnableComment, $cegEnableCommentFor;
@@ -59,7 +59,7 @@
$title = Title::makeTitle( CE_COMMENT_NS, $title );
}
$article = new Article( $title );
-   
+
# check if comments are enabled #
if ( !isset( $cegEnableComment ) || !$cegEnableComment ) {
wfProfileOut( __METHOD__ . ' [SemanticComments]' );
@@ -70,92 +70,93 @@
}
# check authorization #
if ( !isset( $cegEnableCommentFor )
-   || ( $cegEnableCommentFor == CE_COMMENT_NOBODY )
-   || ( ( $cegEnableCommentFor == CE_COMMENT_AUTH_ONLY ) 
&& $wgUser->isAnon() ) )
+   || ( $cegEnableCommentFor == CE_COMMENT_NOBODY )
+   || ( ( $cegEnableCommentFor == CE_COMMENT_AUTH_ONLY ) && 
$wgUser->isAnon() ) )
{
wfProfileOut( __METHOD__ . ' [SemanticComments]' );
return CECommentUtils::createXMLResponse(
wfMessage( 'ce_cf_disabled' )->text(),
self::PERMISSION_ERROR, $pageName );
-   } else {
-   //user is allowed
-   if ( $article->exists() && !$editMode ) {
-   wfProfileOut( __METHOD__ . ' 
[SemanticComments]' );
-   return CECommentUtils::createXMLResponse(
-   wfMessage( 'ce_comment_exists', 
$pageName )->text(),
-   self::COMMENT_ALREADY_EXISTS, $pageName
-   );
-   }
-   // Insert current Date
-   $date = new DateTime();
-   $dateString = $date->format( 'c' );
-   if ( $editMode ) {
-try{
-   // use the original DATE!!!
-   $comNS = MWNamespace::getCanonicalName( 
CE_COMMENT_NS );
-   $qandp = 

[MediaWiki-commits] [Gerrit] mediawiki...PageSchemas[master]: Removed deprecated "Article::doEdit("

2016-12-31 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329790 )

Change subject: Removed deprecated "Article::doEdit("
..

Removed deprecated "Article::doEdit("

Bug: T151973
Change-Id: Ib3e2cb5def631ff13e0ff337ee990cfaca840379
---
M PS_CreatePageJob.php
1 file changed, 3 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageSchemas 
refs/changes/90/329790/1

diff --git a/PS_CreatePageJob.php b/PS_CreatePageJob.php
index 713810d..05bdaec 100644
--- a/PS_CreatePageJob.php
+++ b/PS_CreatePageJob.php
@@ -49,16 +49,11 @@
$actual_user = $wgUser;
$wgUser = User::newFromId( $this->params['user_id'] );
$edit_summary = wfMessage( 'ps-generatepages-editsummary' 
)->inContentLanguage()->parse();
-   if ( method_exists( 'WikiPage', 'getContent' ) ) {
-   // MW >= 1.21
-   $content = new WikitextContent( $page_text );
-   $wikiPage->doEditContent( $content, $edit_summary );
-   } else {
-   $article->doEdit( $page_text, $edit_summary );
-   }
+   $content = new WikitextContent( $page_text );
+   $wikiPage->doEditContent( $content, $edit_summary );
+
$wgUser = $actual_user;
wfProfileOut( __METHOD__ );
return true;
}
 }
-

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3e2cb5def631ff13e0ff337ee990cfaca840379
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageSchemas
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...OfflineImportLexicon[master]: Replaced deprecated "Article::doEdit("

2016-12-31 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329789 )

Change subject: Replaced deprecated "Article::doEdit("
..

Replaced deprecated "Article::doEdit("

Bug: T151973
Change-Id: I61736a07763a262b5a87aef887b09d9d1d7a826a
---
M OfflineImportLexicon_body.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OfflineImportLexicon 
refs/changes/89/329789/1

diff --git a/OfflineImportLexicon_body.php b/OfflineImportLexicon_body.php
index 65459d9..153396b 100644
--- a/OfflineImportLexicon_body.php
+++ b/OfflineImportLexicon_body.php
@@ -326,7 +326,8 @@
 
$article = new Article($titleObj);
$flags = $flags|EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY;
-   $status = $article->doEdit( $content, $summary, 
$flags,false,$wgUser);
+   $articleContent = ContentHandler::makeContent( $content, 
$titleObj );
+   $status = $article->doEditContent( $articleContent, $summary, 
$flags,false,$wgUser);
$result = true;
if ( !$status->isOK() ) {
$result = $status->getErrorsArray();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61736a07763a262b5a87aef887b09d9d1d7a826a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OfflineImportLexicon
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Replaced deprecated Article::doEdit(

2016-12-31 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329787 )

Change subject: Replaced deprecated Article::doEdit(
..

Replaced deprecated Article::doEdit(

Bug: T151973
Change-Id: Iaa729e81397bacd900ad389d439bfbaf60dabeb8
---
M import/import-parsed-discussions.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/87/329787/1

diff --git a/import/import-parsed-discussions.php 
b/import/import-parsed-discussions.php
index 3011668..c670007 100644
--- a/import/import-parsed-discussions.php
+++ b/import/import-parsed-discussions.php
@@ -79,7 +79,7 @@
 
$root = new Article( $title, 0 );
 
-   $root->doEdit(
+   $root->doEditContent(
ContentHandler::makeContent( $info['content'], $title ),
'Imported from JSON',
EDIT_NEW,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa729e81397bacd900ad389d439bfbaf60dabeb8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Updated docs in EchoNewsletterUserLocator

2016-12-30 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329686 )

Change subject: Updated docs in EchoNewsletterUserLocator
..

Updated docs in EchoNewsletterUserLocator

Bug: T154230
Change-Id: I0addb017ff60f4d503c0b2b484a506ba41816ee5
---
M includes/Echo/EchoNewsletterUserLocator.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/86/329686/1

diff --git a/includes/Echo/EchoNewsletterUserLocator.php 
b/includes/Echo/EchoNewsletterUserLocator.php
index b70281d..31bc89f 100644
--- a/includes/Echo/EchoNewsletterUserLocator.php
+++ b/includes/Echo/EchoNewsletterUserLocator.php
@@ -5,7 +5,7 @@
 * Locate all users subscribed to a newsletter.
 *
 * @param EchoEvent $event
-* @return User[]|array empty if the newsletter has been deleted/invalid
+* @return UserArray|array empty if the newsletter has been 
deleted/invalid
 */
public static function locateNewsletterSubscribedUsers( EchoEvent 
$event ) {
$extra = $event->getExtra();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0addb017ff60f4d503c0b2b484a506ba41816ee5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Newsletter cleanup

2016-12-30 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329680 )

Change subject: Newsletter cleanup
..

Newsletter cleanup

Added docs to some functions, and declared $createNew as instance variable.

Bug: T153906
Change-Id: If5fcee346f9a5177898d254298aeda09ddd7099e
---
M includes/NewsletterEditPage.php
M includes/NewsletterStore.php
2 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/80/329680/1

diff --git a/includes/NewsletterEditPage.php b/includes/NewsletterEditPage.php
index 0532f34..a3a0463 100644
--- a/includes/NewsletterEditPage.php
+++ b/includes/NewsletterEditPage.php
@@ -1,7 +1,7 @@
 db = $db;
$this->logger = $logger;
}
-
+   /**
+* @return NewsletterStore instance of NewsletterStore
+*/
public static function getDefaultInstance(){
if ( !self::$instance ) {
self::$instance = new self(
@@ -198,7 +200,7 @@
/**
 * @param int $id
 *
-* @return string[]
+* @return int[]
 */
public function getSubscribersFromID( $id ) {
return $this->db->getSubscribersFromID( $id );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5fcee346f9a5177898d254298aeda09ddd7099e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: [WIP] Added notifications to manually added users

2016-12-28 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329456 )

Change subject: [WIP] Added notifications to manually added users
..

[WIP] Added notifications to manually added users

Bug: T154143
Change-Id: I22160066ac2ef0430c1c5286ebba8310b448b208
---
M Newsletter.hooks.php
M i18n/en.json
M includes/specials/SpecialNewsletter.php
3 files changed, 61 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/56/329456/1

diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php
index 98cf4b3..ca49f56 100755
--- a/Newsletter.hooks.php
+++ b/Newsletter.hooks.php
@@ -32,7 +32,7 @@
'user-locators' => array(

'EchoNewsletterUserLocator::locateNewsletterSubscribedUsers',
),
-   'presentation-model' => 
'EchoNewsletterPresentationModel',
+   'presentation-model' => 'c',
'title-message' => 'newsletter-notification-title',
'title-params' => array( 'newsletter-name', 'title', 
'agent', 'user' ),
'flyout-message' => 'newsletter-notification-flyout',
@@ -59,6 +59,34 @@
'flyout-message' => 
'newsletter-notification-new-publisher-flyout',
'flyout-params' => array( 'newsletter-name', 'agent' ),
);
+   $notifications['newsletter-subscribed'] = array(
+   'category' => 'newsletter',
+   'section' => 'alert',
+   'primary-link' => array(
+   'message' => 
'newsletter-notification-subscribed',
+   'destination' => 'newsletter'
+   ),
+   'user-locators' => array(
+   array( 'EchoUserLocator::locateFromEventExtra', 
array( 'subscribers-id' ) )
+   ),
+   'presentation-model' => 
'EchoNewsletterPublisherPresentationModel',
+   'title-message' => 'newsletter-notification-subscribed',
+   'title-params' => array( 'newsletter-name' ),
+   );
+   $notifications['newsletter-unsubscribed'] = array(
+   'category' => 'newsletter',
+   'section' => 'alert',
+   'primary-link' => array(
+   'message' => 
'newsletter-notification-unsubscribed',
+   'destination' => 'newsletter'
+   ),
+   'user-locators' => array(
+   array( 'EchoUserLocator::locateFromEventExtra', 
array( 'subscribers-id' ) )
+   ),
+   'presentation-model' => 
'EchoNewsletterPublisherPresentationModel',
+   'title-message' => 'newsletter-notification-subscribed',
+   'title-params' => array( 'newsletter-name' ),
+   );
 
return true;
}
diff --git a/i18n/en.json b/i18n/en.json
index 2eefef7..254874c 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -103,6 +103,8 @@
"echo-category-title-newsletter": "Newsletters",
"echo-pref-tooltip-newsletter": "Notify me when any of the newsletters 
to which I have subscribed to announces a new issue.",
"newsletter-notification-title": "[[User:$3|$3]] {{GENDER:$4|has 
announced}} a [[$2|new issue]] of the newsletter \"$1\".",
+   "newsletter-notification-subscribed": "You have been subscribed to the 
\"$1\" newsletter by an administrator.",
+   "newsletter-notification-unsubscribed": "You have been unsubscribed 
from the \"$1\" newsletter by an administrator.",
"newsletter-notification-flyout": "$2 {{GENDER:$3|has announced}} a new 
issue of $1.",
"newsletter-notification-link-text-new-issue": "View new issue",
"newsletter-notification-link-text-view-newsletter": "View newsletter",
diff --git a/includes/specials/SpecialNewsletter.php 
b/includes/specials/SpecialNewsletter.php
index 42fd2d2..44eae53 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -483,6 +483,36 @@
$out = $this->getOutput();
// Now report to the user
if ( $added || $removed ) {
+   if ( !class_exists( 'EchoEvent') ) {
+   throw new Exception( 'Echo extension is not 
installed.' );
+   }
+   if ( $added ) {
+   EchoEvent::create(
+   array(
+   'type' => 
'newsletter-subscribed',
+   

[MediaWiki-commits] [Gerrit] mediawiki...DPLforum[master]: Replaced deprecated "Linker::link"

2016-12-27 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329342 )

Change subject: Replaced deprecated "Linker::link"
..

Replaced deprecated "Linker::link"

Bug: T149346
Change-Id: I6f66d48387dccdc34cf3df579eac3a473c660042
---
M DPLforum_body.php
1 file changed, 12 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DPLforum 
refs/changes/42/329342/1

diff --git a/DPLforum_body.php b/DPLforum_body.php
index 78a9ef6..96df7d4 100644
--- a/DPLforum_body.php
+++ b/DPLforum_body.php
@@ -25,6 +25,8 @@
  * @ingroup Extensions
  */
 
+ use MediaWiki\MediaWikiServices;
+
 if ( !defined( 'MEDIAWIKI' ) ) {
echo( "This file is an extension to the MediaWiki software and is not a 
valid access point" );
die( 1 );
@@ -464,7 +466,7 @@
function buildOutput( $page, $title, $time, $user = '', $author = '', 
$made = '' ) {
$tableMode =& $this->bTableMode;
$output = '';
-
+   $linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
if ( $this->bAddCreationDate ) {
if ( is_numeric( $made ) ) {
$made = $this->date( $made, 'date', 
$this->sCreationDateFormat );
@@ -472,10 +474,10 @@
 
if ( $page && $this->bLinkHistory && 
!$this->bAddLastEdit ) {
if ( $this->bEmbedHistory ) {
-   $made = Linker::link( $page, $made, 
array(), array( 'action' => 'history' ), array( 'known' ) );
+   $made = $linkRenderer->makeLink( $page, 
$made, array(), array( 'action' => 'history' ), array( 'known' ) );
} else {
-   $made .= ' (' . Linker::link( $page,
-   wfMessage( 'hist' )->escaped(), 
array(), array( 'action' => 'history' ), array( 'known' ) ) . ')';
+   $made .= ' (' . 
$linkRenderer->makeLink( $page,
+   wfMessage( 'hist' )->text(), 
array(), array( 'action' => 'history' ), array( 'known' ) ) . ')';
}
}
 
@@ -511,14 +513,14 @@
}
}
 
-   $output .= Linker::link( $title, $text, $props, $query, array( 
'known' ) );
+   $output .= $linkRenderer->makeLink( $title, $text, $props, 
$query, array( 'known' ) );
$text = '';
 
if ( $this->bAddAuthor ) {
$author = Title::newFromText( $author, NS_USER );
 
if ( $author ) {
-   $author = Linker::link( $author, 
$author->getText(), array(), array(), array( 'known' ) );
+   $author = $linkRenderer->makeLink( $author, 
$author->getText(), array(), array(), array( 'known' ) );
}
 
if ( $tableMode ) {
@@ -545,10 +547,10 @@
 
if ( $page && $this->bLinkHistory ) {
if ( $this->bEmbedHistory ) {
-   $time = Linker::link( $page, $time, 
array(), array( 'action' => 'history' ), array( 'known' ) );
+   $time = $linkRenderer->makeLink( $page, 
$time, array(), array( 'action' => 'history' ), array( 'known' ) );
} else {
-   $time .= ' (' . Linker::link( $page,
-   wfMessage( 'hist' )->escaped(), 
array(), array( 'action' => 'history' ), array( 'known' ) ) . ')';
+   $time .= ' (' . 
$linkRenderer->makeLink( $page,
+   wfMessage( 'hist' )->text(), 
array(), array( 'action' => 'history' ), array( 'known' ) ) . ')';
}
}
 
@@ -563,7 +565,7 @@
$user = Title::newFromText( $user, NS_USER );
 
if ( $user ) {
-   $user = Linker::link( $user, $user->getText(), 
array(), array(), array( 'known' ) );
+   $user = $linkRenderer->makeLink( $user, 
$user->getText(), array(), array(), array( 'known' ) );
}
 
if ( $tableMode ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f66d48387dccdc34cf3df579eac3a473c660042
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DPLforum
Gerrit-Branch: master
Gerrit-Owner: Filip 

___

[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Newsletter.hook.php cleanup

2016-12-26 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329260 )

Change subject: Newsletter.hook.php cleanup
..

Newsletter.hook.php cleanup

Bug: T154136
Change-Id: Iede3a2ea76869f65a43ef2ba3b23fd79010a587a
---
M Newsletter.hooks.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/60/329260/1

diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php
index 3c74ba5..c31f81a 100755
--- a/Newsletter.hooks.php
+++ b/Newsletter.hooks.php
@@ -237,8 +237,9 @@
return true;
}
}
-   // Show error message and allow resubmitting in case of failure
-   return Status::newFatal( 'newsletter-restore-failure', 
$newsletterName );
+   // Throw error message
+   throw new ErrorPageError( 
'newsletter-restore-failure','newsletter-restore-failure' );
+   return true;
}
 
/**
@@ -253,7 +254,7 @@
if ( $newsletter ) {

NewsletterStore::getDefaultInstance()->updateName( $newsletter->getId(), 
$newtitle->getText() );
} else {
-   throw new MWException( 'Cannot find 
newsletter with name \"' + $title->getText() + '\"' );
+   throw new MWException( 'Cannot find 
newsletter with name \"' . $title->getText() . '\"' );
}
}
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iede3a2ea76869f65a43ef2ba3b23fd79010a587a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Removed unused SpecialNewsletter:getNewsletterActionButtons()

2016-12-26 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329216 )

Change subject: Removed unused SpecialNewsletter:getNewsletterActionButtons()
..

Removed unused SpecialNewsletter:getNewsletterActionButtons()

Bug: T154120
Change-Id: I7b49641eaab564b9ce45f007cc188c18bb1a1742
---
M includes/specials/SpecialNewsletter.php
1 file changed, 0 insertions(+), 66 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/16/329216/1

diff --git a/includes/specials/SpecialNewsletter.php 
b/includes/specials/SpecialNewsletter.php
index 811ddc5..c94d22c 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -91,72 +91,6 @@
}
 
/**
-* Get the navigation links shown in the subtitle
-*
-* @param string|null $current subpage currently being shown, null if 
default "view" page
-*/
-   protected function getNavigationLinks( $current ) {
-   $linkRenderer = $this->getLinkRenderer();
-   $listLink = $linkRenderer->makeKnownLink(
-   SpecialPage::getTitleFor( 'Newsletters' ),
-   $this->msg( 'backlinksubtitle',
-   $this->msg( 'newsletter-subtitlelinks-list' 
)->text()
-   )->text()
-   );
-   if ( $current === null ) {
-   // We've the fancy buttons on the default "view" page 
so don't
-   // add redundant navigation links and fast return here
-   return $listLink;
-   }
-
-   // Build the links taking the current user's access levels into 
account
-   $user = $this->getUser();
-   $actions = array();
-   if ( $user->isLoggedIn() ) {
-   $actions[] = $this->newsletter->isSubscribed( $user )
-   ? self::NEWSLETTER_UNSUBSCRIBE
-   : self::NEWSLETTER_SUBSCRIBE;
-   }
-   if ( $this->newsletter->isPublisher( $user ) ) {
-   $actions[] = self::NEWSLETTER_ANNOUNCE;
-   }
-   if ( $this->newsletter->canManage( $user ) ) {
-   $actions[] = self::NEWSLETTER_MANAGE;
-   $actions[] = self::NEWSLETTER_SUBSCRIBERS;
-   }
-
-   $links = array();
-   foreach ( $actions as $action ) {
-   $title = $this->getPageTitle( 
$this->newsletter->getId() . '/' . $action );
-   // Messages used here: 
'newsletter-subtitlelinks-announce',
-   // 'newsletter-subtitlelinks-subscribe', 
'newsletter-subtitlelinks-unsubscribe'
-   // 'newsletter-subtitlelinks-manage'
-   $msg = $this->msg( 'newsletter-subtitlelinks-' . 
$action )->text();
-   $link = $linkRenderer->makeKnownLink( $title, $msg );
-   if ( $action == self::NEWSLETTER_MANAGE ) {
-   $title = Title::makeTitleSafe( NS_NEWSLETTER, 
$this->newsletter->getName() );
-   $msg = $this->msg( 'newsletter-subtitlelinks-' 
. $action )->text();
-   $link = $linkRenderer->makeKnownLink( $title, 
$msg, [], ['action'=>'edit'] );
-   }
-   if ( $current === $action ) {
-   $links[] = Linker::makeSelfLinkObj( $title, 
$msg );
-   } else {
-
-   $links[] = $link;
-   }
-   }
-
-   $newsletterLinks = $linkRenderer->makeKnownLink(
-   Title::makeTitleSafe( NS_NEWSLETTER, 
$this->newsletter->getName() ),
-   $this->getName()
-   ) . ' ' . $this->msg( 'parentheses' )
-   ->rawParams( $this->getLanguage()->pipeList( $links ) )
-   ->text();
-
-   return $this->getLanguage()->pipeList( array( $listLink, 
$newsletterLinks ) );
-   }
-
-   /**
 * Create a common HTMLForm which can be used by specific page actions
 *
 * @param array $fields array of form fields

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b49641eaab564b9ce45f007cc188c18bb1a1742
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Subscription functions now take user ids array

2016-12-25 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329137 )

Change subject: Subscription functions now take user ids array
..

Subscription functions now take user ids array

Bug: T154095
Change-Id: I71e2b968637dda8af11777f895b982c3806b2991
---
M includes/Newsletter.php
M includes/NewsletterDb.php
M includes/NewsletterStore.php
M tests/NewsletterDbTest.php
4 files changed, 23 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/37/329137/1

diff --git a/includes/Newsletter.php b/includes/Newsletter.php
index bcc08f0..65644b1 100644
--- a/includes/Newsletter.php
+++ b/includes/Newsletter.php
@@ -189,7 +189,7 @@
 
$store = NewsletterStore::getDefaultInstance();
 
-   if ( $store->addSubscription( $this, $user ) ) {
+   if ( $store->addSubscription( $this, $user->getId() ) ) {
return Status::newGood();
} else {
return Status::newFatal( 'newsletter-subscribe-fail', 
$this->name );
@@ -206,7 +206,7 @@
public function unsubscribe( User $user ) {
$store = NewsletterStore::getDefaultInstance();
 
-   if ( $store->removeSubscription( $this, $user ) ) {
+   if ( $store->removeSubscription( $this, $user->getId() ) ) {
return Status::newGood();
} else {
return Status::newFatal( 'newsletter-unsubscribe-fail', 
$this->name );
diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php
index 3faf358..8494ede 100644
--- a/includes/NewsletterDb.php
+++ b/includes/NewsletterDb.php
@@ -19,18 +19,20 @@
 
/**
 * @param Newsletter $newsletter
-* @param User $user
+* @param array $user_ids
 *
 * @return bool success of the action
 */
-   public function addSubscription( Newsletter $newsletter, User $user ) {
-   $rowData = array(
-   'nls_newsletter_id' => $newsletter->getId(),
-   'nls_subscriber_id' => $user->getId(),
-   );
-
+   public function addSubscription( Newsletter $newsletter, $user_ids ) {
+   $rows = array();
+   foreach ( (array) $user_ids as $user_id ) {
+   $rows[] = array(
+   'nls_newsletter_id' => $newsletter->getId(),
+   'nls_subscriber_id' => $user_id,
+   );
+   }
$dbw = $this->lb->getConnection( DB_MASTER );
-   $dbw->insert( 'nl_subscriptions', $rowData, __METHOD__, array( 
'IGNORE' ) );
+   $dbw->insert( 'nl_subscriptions', $rows, __METHOD__, array( 
'IGNORE' ) );
$success = (bool)$dbw->affectedRows();
$this->lb->reuseConnection( $dbw );
 
@@ -39,14 +41,14 @@
 
/**
 * @param Newsletter $newsletter
-* @param User $user
+* @param array $user_ids
 *
 * @return bool success of the action
 */
-   public function removeSubscription( Newsletter $newsletter, User $user 
) {
+   public function removeSubscription( Newsletter $newsletter, $user_ids ) 
{
$rowData = array(
-   'nls_newsletter_id' => $newsletter->getId(),
-   'nls_subscriber_id' => $user->getId(),
+   'nls_newsletter_id' => $newsletter->getId(),
+   'nls_subscriber_id' => $user_ids
);
 
$dbw = $this->lb->getConnection( DB_MASTER );
diff --git a/includes/NewsletterStore.php b/includes/NewsletterStore.php
index 51b5936..085655d 100644
--- a/includes/NewsletterStore.php
+++ b/includes/NewsletterStore.php
@@ -40,22 +40,22 @@
 
/**
 * @param Newsletter $newsletter
-* @param User $user
+* @param array $user_ids
 *
 * @return bool success of the action
 */
-   public function addSubscription( Newsletter $newsletter, User $user ) {
-   return $this->db->addSubscription( $newsletter, $user );
+   public function addSubscription( Newsletter $newsletter, $user_ids ) {
+   return $this->db->addSubscription( $newsletter, $user_ids );
}
 
/**
 * @param Newsletter $newsletter
-* @param User $user
+* @param array $user_ids
 *
 * @return bool success of the action
 */
-   public function removeSubscription( Newsletter $newsletter, User $user 
) {
-   return $this->db->removeSubscription( $newsletter, $user );
+   public function removeSubscription( Newsletter $newsletter, $user_ids ) 
{
+   return $this->db->removeSubscription( $newsletter, $user_ids );
}
 

[MediaWiki-commits] [Gerrit] mediawiki...XMLContentExtension[master]: XMLContentExtension cleanup

2016-12-25 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329131 )

Change subject: XMLContentExtension cleanup
..

XMLContentExtension cleanup

Bug: T154109
Change-Id: Ida79de2d54da9700b783025afe4a3b7a5d690130
---
M XMLContentExtension.body.php
M XMLContentExtension.hooks.php
M XMLContentExtension.php
M XMLContentExtension.resources.php
M XMLContentExtension.routes.php
M assets/js/XMLContentExtension.js
M include/NSFunctions.php
R include/XMLContent.class.php
R include/XMLContentHandler.class.php
M include/XMLDocument.class.php
10 files changed, 117 insertions(+), 135 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/XMLContentExtension 
refs/changes/31/329131/1

diff --git a/XMLContentExtension.body.php b/XMLContentExtension.body.php
index a6c1dd3..37ff271 100644
--- a/XMLContentExtension.body.php
+++ b/XMLContentExtension.body.php
@@ -13,8 +13,8 @@
 
   // For some reason both of the following are needed. Otherwise,
   // either displaying or editing files is not possible
-  $wgContentHandlers['CONTENT_MODEL_XML'] = 'XmlContentHandler';
-  $wgContentHandlers[CONTENT_MODEL_XML] = 'XmlContentHandler';
+  $wgContentHandlers['CONTENT_MODEL_XML'] = 'XMLContentHandler';
+  $wgContentHandlers[CONTENT_MODEL_XML] = 'XMLContentHandler';
 
   $wgTextModelsToParse[] = CONTENT_MODEL_XML;
 
@@ -128,5 +128,3 @@
 //wfDebugLog('xml', 'To add :' . print_r($wgXMLContentNamespaces, true));
 return true;
   };*/
-
-?>
diff --git a/XMLContentExtension.hooks.php b/XMLContentExtension.hooks.php
index 21e723d..8fb3ec3 100644
--- a/XMLContentExtension.hooks.php
+++ b/XMLContentExtension.hooks.php
@@ -9,8 +9,7 @@
* Will disallow editing if the new text contains an invalid XML document
*/
   public static function onEditFilterMergedContent( $context, $content, 
$status, $summary, $user, $minoredit ) {
-global $wgXMLContentValidate, $wgXMLContentSyntaxHighlight,
-   $wgXMLContentAllowSavingWithoutValidating;
+global $wgXMLContentValidate;
 
 if(!isXMLNS( $context->getTitle()->getNamespace() )) {
   return true; // Do nothing
@@ -33,7 +32,7 @@
   $xml->validateXML();
 
   if(count($xml->getErrors()) > 0) {
-$xmlContent = new XmlContent($text);
+$xmlContent = new XMLContent($text);
 $error = $xmlContent->getPreparedText();
 $GLOBALS['XMLContentContainsXMLErrors'] = true;
 
@@ -51,7 +50,6 @@
   }
 
   public static function onEditPageBeforeEditButtons( &$editpage, &$buttons, 
&$tabindex ) {
-global $wgXMLContentAllowSavingWithoutValidating;
 
 if(!isXMLNS($editpage->getTitle()->getNamespace())) {
   return true; // Do nothing
@@ -82,7 +80,7 @@
* do it, otherwise return the article (or show missing article)
*/
   public static function RESTRoute($title) {
-global $wgExtraNamespaces, $wgXMLContentSpecialSubpages;
+global $wgXMLContentSpecialSubpages;
 
 // No routing for other namespaces and regular articles
 if(get_class($title) != 'Title'
@@ -157,7 +155,7 @@
* it. It is basically a copy of 
includes/SkinTemplate.php::buildContentNavigationUrls()
*/
   public static function onSkinTemplateNavigation($skinTemplate, &$navigation) 
{
-global $wgXMLContentSpecialSubpages, $wgDisableLangConversion;
+global $wgXMLContentSpecialSubpages;
 
$title = $skinTemplate->getRelevantTitle();
 $subjectNS = $title->getSubjectPage()->getNamespace();
@@ -446,7 +444,6 @@
   }
 
   public static function addResources(OutputPage &$out, Skin &$skin) {
-global $wgScriptPath;
 
 if(!isXMLNS($out->getTitle()->getNamespace())) {
   return true; // Do nothing
@@ -493,16 +490,16 @@
   && array_key_exists('templateObj', $GLOBALS)) {
   MWDebug::log('Getting xmlDocument from GLOBAL');
   $xmlContentObject = $GLOBALS['templateObj'];
-  $xmlDocument = $xmlContentObject->getXml();
+  $xmlDocument = $xmlContentObject->getXML();
 } else {
   $xmlContentObject = $editPage->getArticle()->getPage()->getContent();
   $content = $editPage->getContent();
   if(empty($content)) {
 MWDebug::log('Creating empty xmlDocument');
-$xmlDocument = new XmlDocument('');
+$xmlDocument = new XMLDocument('');
   } else {
 MWDebug::log('Creating xmlDocument from page content');
-$xmlDocument = new XmlDocument($editPage->getContent());
+$xmlDocument = new XMLDocument($editPage->getContent());
   }
 }
 
@@ -562,5 +559,3 @@
   }
 
 }
-
-?>
diff --git a/XMLContentExtension.php b/XMLContentExtension.php
index 25a1b22..3f459d6 100644
--- a/XMLContentExtension.php
+++ b/XMLContentExtension.php
@@ -5,7 +5,7 @@
'version' => 0.1,
'author' => 'Johannes Nanninga 
(mailto:johannes.nanni...@stud.uni-due.de)',
'url' => 'https://www.mediawiki.org/wiki/Extension:XMLContentExtension',
-   'descriptiondesc' => 

[MediaWiki-commits] [Gerrit] mediawiki...XMLContentExtension[master]: Replaced deprecated hook usage

2016-12-25 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329125 )

Change subject: Replaced deprecated hook usage
..

Replaced deprecated hook usage

Replaced deprecated "EditFilterMerged" hook usage, with 
"EditFilterMergedContent"

Bug: T151973
Change-Id: Ie46107830ef8506b39284eff5ac6f9393462a327
---
M XMLContentExtension.body.php
M XMLContentExtension.hooks.php
2 files changed, 10 insertions(+), 10 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/XMLContentExtension 
refs/changes/25/329125/1

diff --git a/XMLContentExtension.body.php b/XMLContentExtension.body.php
index 722ca11..a6c1dd3 100644
--- a/XMLContentExtension.body.php
+++ b/XMLContentExtension.body.php
@@ -81,7 +81,7 @@
 
   // Enables REST style subpages. Keys are the keywords, values the method to 
be
   // called when encountering the keyword. E. g.:
-  // 'raw => 'XMLDocument::respondWithRawXMLAndDie' means that the function 
+  // 'raw => 'XMLDocument::respondWithRawXMLAndDie' means that the function
   // XMLDocument::respondWithRawXMLAndDie will be called whenever a user 
requests
   // the the page host/wiki/XML:myFile/raw
   $wgXMLContentSpecialSubpages = array(
@@ -91,7 +91,7 @@
 
 
   // Enables checking the input before it is put into the database
-  $wgHooks['EditFilterMerged'][] = 
'XMLContentExtensionHooks::onEditFilterMerged';
+  $wgHooks['EditFilterMergedContent'][] = 
'XMLContentExtensionHooks::onEditFilterMergedContent';
 
   // Enables the user to override error checking before saving
   $wgHooks['EditPageBeforeEditButtons'][] = 
'XMLContentExtensionHooks::onEditPageBeforeEditButtons';
@@ -102,7 +102,7 @@
 
   // Check XML file for style sheets. If there is one, it will be used TODO 
fix function names
   $wgHooks['ArticleContentViewCustom'][] = 
'XMLContentExtensionHooks::onArticleContentViewCustom';
-  
+
   // Sets the header to xml/text when the article is in the XML namespace
   $wgHooks['rawPageViewBeforeOutput'][] = 
'XMLContentExtensionHooks::onRawPageViewBeforeOutput';
 
diff --git a/XMLContentExtension.hooks.php b/XMLContentExtension.hooks.php
index 0589f9b..bf9f150 100644
--- a/XMLContentExtension.hooks.php
+++ b/XMLContentExtension.hooks.php
@@ -8,11 +8,11 @@
   /**
* Will disallow editing if the new text contains an invalid XML document
*/
-  public static function onEditFilterMerged($editor, $text, &$error, $summary) 
{
+  public static function onEditFilterMergedContent( $context, $content, 
$status, $summary, $user, $minoredit ) {
 global $wgXMLContentValidate, $wgXMLContentSyntaxHighlight,
$wgXMLContentAllowSavingWithoutValidating;
 
-if(!isXMLNS($editor->mTitle->getNamespace())) {
+if(!isXMLNS($context->getTitle()->getNamespace())) {
   return true; // Do nothing
 }
 
@@ -25,7 +25,7 @@
   return true; // Do nothing
 }
 
-
+$text = ContentHandler::getContentText( $content );
 // Check XML for validity. If invalid, show raw XML and error message
 // If valid, show raw XML, an XSLT output, or a custom parser output
 if(isset($wgXMLContentValidate) && $wgXMLContentValidate == true) {
@@ -57,7 +57,7 @@
   return true; // Do nothing
 }
 
-// Insert checkbox for overriding XML errors only if extenstion settings 
+// Insert checkbox for overriding XML errors only if extenstion settings
 // allow it and the XML actually contains errors.
 if(isset($wgXMLContentAllowSavingWithoutValidating)
   && $wgXMLContentAllowSavingWithoutValidating == true
@@ -71,7 +71,7 @@
. ''
. ''
. 'Override Errors'
-   . ' | ';  
+   . ' | ';
 }
 
 return true;
@@ -131,7 +131,7 @@
 if(!isXMLNS($title->getNamespace())) {
   return true; // Do nothing
 }
-
+
 $text = $content->getNativeData();
 
 $xml = new XMLDocument($text);
@@ -433,7 +433,7 @@
 if(!isXMLNS($out->getTitle()->getNamespace())) {
   return true; // Do nothing
 }
-
+
 $action = $out->getContext()->getRequest()->getVal('action');
 
 // $action == '' means the normal action

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie46107830ef8506b39284eff5ac6f9393462a327
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/XMLContentExtension
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...AkismetKlik[master]: Replaced deprecated hook usage

2016-12-25 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329122 )

Change subject: Replaced deprecated hook usage
..

Replaced deprecated hook usage

Replaced deprecated "EditFilterMerged" hook usage, with 
"EditFilterMergedContent"

Bug: T151973
Change-Id: I82cfde36a490ece9096ebe5ca8cfc0b835db9bbb
---
M AkismetKlik.php
1 file changed, 15 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AkismetKlik 
refs/changes/22/329122/1

diff --git a/AkismetKlik.php b/AkismetKlik.php
index 5adc92e..948296e 100644
--- a/AkismetKlik.php
+++ b/AkismetKlik.php
@@ -25,7 +25,7 @@
 
 # Loader for spam blacklist feature
 # Include this from LocalSettings.php
-$wgHooks['EditFilterMerged'][] = 'wfAkismetFilterMerged';
+$wgHooks['EditFilterMergedContent'][] = 'wfAkismetFilterMergedContent';
 
 /**
  * Get an instance of AkismetKlik and do some first-call initialisation.
@@ -44,14 +44,18 @@
 }
 
 /**
- * Hook function for EditFilterMerged, replaces wfAkismetFilter
- * @param $editPage EditPage
- * @param $text string
+ * Hook function for EditFilterMergedContent, replaces wfAkismetFilter
+ * @param $context IContextSource
+ * @param $content Content
+ * @param $status Status
+ * @param $summary string
+ * @param $user User
+ * @param $minoredit bool
  * @return bool
  */
-function wfAkismetFilterMerged( $editPage, $text ) {
+function wfAkismetFilterMergedContent( $context, $content, $status, $summary, 
$user, $minoredit ) {
$spamObj = new AkismetKlik();
-   $ret = $spamObj->filter( $editPage->getArticle()->getTitle(), $text, 
'', $editPage );
+   $ret = $spamObj->filter( $context->getTitle(), $content, '', 
$context->getWikiPage() );
 
return !$ret;
 }
@@ -73,14 +77,14 @@
 
/**
 * @param Title $title
-* @param string $text Text of section, or entire text if 
$editPage!=false
+* @param Content $content Content of sections
 * @param string $section Section number or name
-* @param EditPage $editPage EditPage passed from EditFilterMerged
+* @param WikiPage $editPage WikiPage passed from 
EditFilterMergedContent
 * @throws MWException
 * @return bool True if the edit should not be allowed, false otherwise
 * If the return value is true, an error will have been sent to $wgOut
 */
-   function filter( $title, $text, $section, $editPage ) {
+   function filter( $title, $content, $section, $editPage ) {
global $wgUser, $wgAKSiteUrl, $wgAKkey;
// @codingStandardsIgnoreStart
global $IP;
@@ -95,8 +99,8 @@
$text = str_replace( '.', '.', $text );
 
# Run parser to strip SGML comments and such out of the markup
-   $content = ContentHandler::makeContent( $text, $title );
-   $editInfo = $editPage->getArticle()->prepareContentForEdit( 
$content );
+   $text = ContentHandler::getContentText( $content );
+   $editInfo = $editPage->prepareContentForEdit( $content );
$out = $editInfo->output;
$pgtitle = $title;
$links = implode( "\n", array_keys( $out->getExternalLinks() ) 
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82cfde36a490ece9096ebe5ca8cfc0b835db9bbb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AkismetKlik
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikilog[master]: Replaced deprecated hook usage

2016-12-25 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329121 )

Change subject: Replaced deprecated hook usage
..

Replaced deprecated hook usage

Replaced deprecated "ArticleSave" hook usage, with "PageContentSave"

Bug: T151973
Change-Id: I6048dddcad5cc455ca4141a071a7df896393b3a2
---
M Wikilog.php
M WikilogHooks.php
2 files changed, 11 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikilog 
refs/changes/21/329121/1

diff --git a/Wikilog.php b/Wikilog.php
index d0af4b7..c0a64e1 100644
--- a/Wikilog.php
+++ b/Wikilog.php
@@ -140,7 +140,7 @@
 // General Wikilog hooks
 $wgHooks['ArticleEditUpdates'][] = 'WikilogHooks::ArticleEditUpdates';
 $wgHooks['ArticleDeleteComplete'][] = 'WikilogHooks::ArticleDeleteComplete';
-$wgHooks['ArticleSave'][] = 'WikilogHooks::ArticleSave';
+$wgHooks['PageContentSave'][] = 'WikilogHooks::PageContentSave';
 $wgHooks['TitleMoveComplete'][] = 'WikilogHooks::TitleMoveComplete';
 $wgHooks['EditPage::attemptSave'][] = 'WikilogHooks::EditPageAttemptSave';
 $wgHooks['EditPage::showEditForm:fields'][] = 
'WikilogHooks::EditPageEditFormFields';
diff --git a/WikilogHooks.php b/WikilogHooks.php
index fcd0965..ccee3c1 100644
--- a/WikilogHooks.php
+++ b/WikilogHooks.php
@@ -191,19 +191,23 @@
}
 
/**
-* ArticleSave hook handler function.
-* Add article signature if user selected "sign and publish" option in
+* PageContentSave hook handler function.
+* Add page signature if user selected "sign and publish" option in
 * EditPage.
 */
-   static function ArticleSave( &$article, &$user, &$text, &$summary,
-   $minor, $watch, $sectionanchor, &$flags )
+   static function PageContentSave( &$wikiPage, &$user, &$content, 
&$summary,
+   $isMinor, $isWatch, $section, &$flags, &$status )
{
# $article->mExtWikilog piggybacked from 
WikilogHooks::EditPageAttemptSave().
-   if ( isset( $article->mExtWikilog ) && 
$article->mExtWikilog['signpub'] ) {
+   if ( isset( $wikiPage->mExtWikilog ) && 
$wikiPage->mExtWikilog['signpub'] ) {
$t = WikilogUtils::getPublishParameters();
$txtDate = $t['date'];
$txtUser = $t['user'];
-   $text = rtrim( $text ) . "\n{{wl-publish: {$txtDate} | 
{$txtUser} }}\n";
+   # Add signature to page content's text
+   $text = rtrim( ContentHandler::getContentText( $content 
) )
+   . "\n{{wl-publish: {$txtDate} | {$txtUser} 
}}\n";
+   # Now, create content from edited text
+   $content = ContentHandler::makeContent( $text, 
$wikiPage->getTitle() );
}
return true;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6048dddcad5cc455ca4141a071a7df896393b3a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikilog
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Quiz[master]: Added valid composer.json

2016-12-24 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329054 )

Change subject: Added valid composer.json
..

Added valid composer.json

Bug: T152291
Change-Id: Ie22d2f0e442043947621691207d1aa0c12ce52d7
---
A composer.json
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz 
refs/changes/54/329054/1

diff --git a/composer.json b/composer.json
new file mode 100644
index 000..1c63f9e
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,10 @@
+{
+   "require-dev": {
+   "jakub-onderka/php-parallel-lint": "0.9.2"
+   },
+   "scripts": {
+   "test": [
+   "parallel-lint . --exclude vendor"
+   ]
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie22d2f0e442043947621691207d1aa0c12ce52d7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Quiz
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...BreadCrumbs[master]: Replaced Linker::link() usages with LinkRenderer

2016-12-23 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328894 )

Change subject: Replaced Linker::link() usages with LinkRenderer
..

Replaced Linker::link() usages with LinkRenderer

Bug: T149346
Change-Id: I3cbc6005d1d1d7a31c619573871fa74996624efe
---
M BreadCrumbsFunctions.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BreadCrumbs 
refs/changes/94/328894/1

diff --git a/BreadCrumbsFunctions.php b/BreadCrumbsFunctions.php
index 8ea1c33..95e7580 100644
--- a/BreadCrumbsFunctions.php
+++ b/BreadCrumbsFunctions.php
@@ -9,6 +9,7 @@
  * @copyright © 2007 by Manuel Schneider, 2012 by Tony Boyles, Milcord llc
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
+ use MediaWiki\MediaWikiServices;
 
 if ( !defined( 'MEDIAWIKI' ) ) {
echo( "This file is an extension to the MediaWiki software and cannot 
be used standalone.\n" );
@@ -77,12 +78,13 @@
$title = Title::newFromText( $m_BreadCrumbs[$j] );
if ( !in_array( $title->getNsText(), 
$wgBreadCrumbsIgnoreNameSpaces ) ) {
if ( $wgBreadCrumbsLink ) {
+   $linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
# For whatever reason, the Linker doesn't play 
nice in Versions before 1.18.0...
if ( version_compare( 
SpecialVersion::getVersion(), '1.18.0' ) > -1 ) {
if ( 
$wluOptions['breadcrumbs-namespaces'] ) {
-   $breadcrumb = Linker::link( 
$title, $m_BreadCrumbs[$j] );
+   $breadcrumb = 
$linkRenderer->makeLink( $title, $m_BreadCrumbs[$j] );
} else {
-   $breadcrumb = Linker::link( 
$title, $title->getText() );
+   $breadcrumb = 
$linkRenderer->makeLink( $title, $title->getText() );
}
} elseif ( 
$wluOptions['breadcrumbs-namespaces'] ) {
$breadcrumb = 'https://gerrit.wikimedia.org/r/328894
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3cbc6005d1d1d7a31c619573871fa74996624efe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BreadCrumbs
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Replaced Linker::link() usages with LinkRenderer

2016-12-23 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328892 )

Change subject: Replaced Linker::link() usages with LinkRenderer
..

Replaced Linker::link() usages with LinkRenderer

Bug: T149346
Change-Id: I3a2882384586de6589675baf0d1935db4b02804c
---
M RSSStandards/RSSStandards.class.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/92/328892/1

diff --git a/RSSStandards/RSSStandards.class.php 
b/RSSStandards/RSSStandards.class.php
index c082671..423464b 100644
--- a/RSSStandards/RSSStandards.class.php
+++ b/RSSStandards/RSSStandards.class.php
@@ -33,6 +33,8 @@
 // TODO SU (04.07.11 10:37): Userhash für alle Links
 // Last review MRG (01.07.11 14:37)
 // TODO: make RSSStandards methods more generic
+use MediaWiki\MediaWikiServices;
+
 class RSSStandards extends BsExtensionMW {
 
protected function initExt() {
@@ -371,7 +373,7 @@
$_hash = $wgRequest->getVal( 'h', '' );
if ( !( $user && $_hash == md5( 
$_user.$user->getToken().$user->getId() ) ) || $user->isAnon() ) {
$oTitle = SpecialPage::getTitleFor( 'Userlogin' 
);
-   $sLink = Linker::link(
+   $sLink = 
MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
$oTitle,
wfMessage( 'loginreqlink' )->plain(),
array(),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a2882384586de6589675baf0d1935db4b02804c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlogPage[master]: Replaced Linker::link() usages with LinkRenderer

2016-12-23 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328891 )

Change subject: Replaced Linker::link() usages with LinkRenderer
..

Replaced Linker::link() usages with LinkRenderer

Bug: T149346
Change-Id: I436127cd3d5c4bdd63da060205b10b9ea65f453a
---
M BlogPageClass.php
1 file changed, 10 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlogPage 
refs/changes/91/328891/1

diff --git a/BlogPageClass.php b/BlogPageClass.php
index 29c9b30..efb66fc 100644
--- a/BlogPageClass.php
+++ b/BlogPageClass.php
@@ -4,6 +4,8 @@
  *
  * @file
  */
+use MediaWiki\MediaWikiServices;
+
 class BlogPage extends Article {
 
public $title = null;
@@ -253,7 +255,10 @@
wfMessage( 'blog-and' ) -escaped() .
wfMessage( 'word-separator' 
)->escaped();
}
-   $authors .= Linker::link( $userTitle, 
$author['user_name'] );
+   $authors .= 
MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
+   $userTitle,
+   $author['user_name']
+   );
}
 
$output .= $authors;
@@ -296,7 +301,10 @@
wfMessage( 'blog-and' )->escaped() .
wfMessage( 'word-separator' 
)->escaped();
}
-   $authors .= Linker::link( $userTitle, 
$author['user_name'] );
+   $authors .= 
MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
+   $userTitle,
+   $author['user_name']
+   );
}
 
$output = '' .

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I436127cd3d5c4bdd63da060205b10b9ea65f453a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlogPage
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fixed PHP issues found by phan

2016-12-22 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328679 )

Change subject: Fixed PHP issues found by phan
..

Fixed PHP issues found by phan

Fixed some PHP issues found by phan static code analysis

Bug: T153252
Change-Id: I18d94c03286c9d97cecc4620fa51f788c3edd446
---
M includes/api/ApiHelp.php
M includes/api/ApiParse.php
M includes/filerepo/ForeignAPIRepo.php
M includes/media/SVG.php
M includes/specials/SpecialWhatlinkshere.php
M includes/user/User.php
M maintenance/mergeMessageFileList.php
M tests/phan/config.php
8 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/79/328679/1

diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php
index 9a0d3ff..21118e8 100644
--- a/includes/api/ApiHelp.php
+++ b/includes/api/ApiHelp.php
@@ -519,6 +519,7 @@
case 
'submodule':

$groups[] = $name;
if ( 
isset( $settings[ApiBase::PARAM_SUBMODULE_MAP] ) ) {
+   
/** @var array */

$map = $settings[ApiBase::PARAM_SUBMODULE_MAP];

ksort( $map );

$submodules = [];
diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php
index 287ffb7..e4c6993 100644
--- a/includes/api/ApiParse.php
+++ b/includes/api/ApiParse.php
@@ -580,6 +580,7 @@
 
private function formatLangLinks( $links ) {
$result = [];
+   /** @suppress PhanTypeMismatchForeach */
foreach ( $links as $link ) {
$entry = [];
$bits = explode( ':', $link, 2 );
diff --git a/includes/filerepo/ForeignAPIRepo.php 
b/includes/filerepo/ForeignAPIRepo.php
index ca41718..74ad702 100644
--- a/includes/filerepo/ForeignAPIRepo.php
+++ b/includes/filerepo/ForeignAPIRepo.php
@@ -150,17 +150,20 @@
if ( isset( $data['query']['pages'] ) ) {
# First, get results from the query. Note we only care 
whether the image exists,
# not whether it has a description page.
+   /** @suppress PhanTypeMismatchForeach */
foreach ( $data['query']['pages'] as $p ) {
$this->mFileExists[$p['title']] = ( 
$p['imagerepository'] !== '' );
}
# Second, copy the results to any redirects that were 
queried
if ( isset( $data['query']['redirects'] ) ) {
+   /** @suppress PhanTypeMismatchForeach */
foreach ( $data['query']['redirects'] as $r ) {
$this->mFileExists[$r['from']] = 
$this->mFileExists[$r['to']];
}
}
# Third, copy the results to any non-normalized titles 
that were queried
if ( isset( $data['query']['normalized'] ) ) {
+   /** @suppress PhanTypeMismatchForeach */
foreach ( $data['query']['normalized'] as $n ) {
$this->mFileExists[$n['from']] = 
$this->mFileExists[$n['to']];
}
@@ -241,6 +244,7 @@
] );
$ret = [];
if ( isset( $results['query']['allimages'] ) ) {
+   /** @suppress PhanTypeMismatchForeach */
foreach ( $results['query']['allimages'] as $img ) {
// 1.14 was broken, doesn't return name 
attribute
if ( !isset( $img['name'] ) ) {
diff --git a/includes/media/SVG.php b/includes/media/SVG.php
index 0cea6d8..3fbf846 100644
--- a/includes/media/SVG.php
+++ b/includes/media/SVG.php
@@ -95,6 +95,7 @@
if ( $metadata ) {
$metadata = $this->unpackMetadata( $metadata );
if ( isset( $metadata['translations'] ) ) {
+   /** @suppress PhanTypeMismatchForeach */
foreach ( $metadata['translations'] as $lang => 
$langType ) {
if ( $langType === 
SVGReader::LANG_FULL_MATCH ) {
$langList[] = $lang;
@@ -438,6 +439,7 @@
$visibleFields = $this->visibleMetadataFields();
 
$showMeta = false;
+ 

[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Added Main page unassign after deteling newsletter

2016-12-21 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328494 )

Change subject: Added Main page unassign after deteling newsletter
..

Added Main page unassign after deteling newsletter

Main page's are now unassigned after newsletter deletion.

Bug: T153690
Change-Id: I3ce5df266e2b1edfd571a0708c72a25881b71578
---
M Newsletter.hooks.php
M i18n/en.json
M i18n/qqq.json
M includes/NewsletterDb.php
M includes/NewsletterEditPage.php
M includes/NewsletterStore.php
M includes/specials/SpecialNewsletterCreate.php
A maintenance/deleteUniqueIndex.php
M sql/nl_newsletters.sql
9 files changed, 50 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/94/328494/1

diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php
index 79da03f..2d7e22d 100755
--- a/Newsletter.hooks.php
+++ b/Newsletter.hooks.php
@@ -222,7 +222,15 @@
if ( !$newsletter->canRestore( $user ) ) {
throw new PermissionsError( 
'newsletter-restore' );
}
-   $success = 
NewsletterStore::getDefaultInstance()->restoreNewsletter( $newsletterName );
+   $store = NewsletterStore::getDefaultInstance();
+   $rows = $store->newsletterExistsForMainPage( 
$newsletter->getPageId() );
+
+   foreach ( $rows as $row ) {
+   if ( (int)$row->nl_main_page_id === 
$newsletter->getPageId() && (int)$row->nl_active === 1 ) {
+   throw new ErrorPageError( 
'newsletter-mainpage-in-use','newsletter-mainpage-in-use' );
+   }
+   }
+   $success = $store->restoreNewsletter( $newsletterName );
if ( $success ) {
return true;
}
diff --git a/i18n/en.json b/i18n/en.json
index 21a59d1..5e3c298 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -22,6 +22,7 @@
"newsletter-create-mainpage-error": "Invalid newsletter main page 
entered. Please try again.",
"newsletter-mainpage-non-existent": "The newsletter main page does not 
exist. Please enter a valid existing page.",
"newsletter-mainpage-in-use": "An existing newsletter has the same main 
page. Please enter another title.",
+   "newsletter-mainpage-in-use-title": "An existing newsletter has the 
same main page.",
"newsletter-create-short-description-error": "The description is too 
short (less than 30 characters). Please try again.",
"newsletter-subtitlelinks-list": "List of newsletters",
"newsletter-subtitlelinks-create": "Create a new newsletter",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 6e2da62..820ca56 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -29,6 +29,7 @@
"newsletter-create-mainpage-error": "Error message shown on 
[[Special:CreateNewsletter]] if the page entered on main page field does not 
exist.",
"newsletter-mainpage-non-existent": "Error message shown if the 
newsletter main page doesn't exist.",
"newsletter-mainpage-in-use": "Error message shown if the newsletter's 
main page is already in use by another newsletter.",
+   "newsletter-mainpage-in-use-title": "Title for 
\"newsletter-mainpage-in-use\"",
"newsletter-create-short-description-error": "Error message shown on 
[[Special:CreateNewsletter]] if the text entered in the description field is 
too short.",
"newsletter-subtitlelinks-list": "Label for link to 
[[Special:Newsletters]] shown under the header on Newsletter special 
pages.\n\nSee also:\n* {{msg-mw|newsletter-subtitlelinks-create}}",
"newsletter-subtitlelinks-create": "Label for link to 
[[Special:CreateNewsletter]] shown under the header on Newsletter special 
pages.\n\nSee also:\n* {{msg-mw|newsletter-subtitlelinks-list}}",
diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php
index 3564ac3..3faf358 100644
--- a/includes/NewsletterDb.php
+++ b/includes/NewsletterDb.php
@@ -444,7 +444,7 @@
 
$res = $dbr->select(
'nl_newsletters',
-   array( 'nl_main_page_id' ),
+   array( 'nl_main_page_id', 'nl_active' ),
array( 'nl_main_page_id' => $mainPageId )
);
 
diff --git a/includes/NewsletterEditPage.php b/includes/NewsletterEditPage.php
index 6c51d7f..624bc35 100644
--- a/includes/NewsletterEditPage.php
+++ b/includes/NewsletterEditPage.php
@@ -208,11 +208,12 @@
$dbr = wfGetDB( DB_SLAVE );
$rows = $dbr->select(
'nl_newsletters',
-   array( 'nl_name', 'nl_main_page_id' ),
+   array( 'nl_name', 'nl_main_page_id', 'nl_active' ),

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Replaced &$this with $this

2016-12-20 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328387 )

Change subject: Replaced &$this with $this
..

Replaced &$this with $this

Replaced unneeded &$this refference

Bug: T153505
Change-Id: I78ea04a01ecce82294837e92c2a05b00ffb6e0f6
---
M includes/api/ApiQueryInfo.php
M includes/api/ApiQueryRecentChanges.php
M includes/api/ApiQueryRevisions.php
M includes/api/ApiQueryUsers.php
4 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/328387/1

diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index fd65038..c98e013 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -117,7 +117,7 @@
'import' => [ 'ApiQueryInfo', 'getImportToken' ],
'watch' => [ 'ApiQueryInfo', 'getWatchToken' ],
];
-   Hooks::run( 'APIQueryInfoTokens', [ &$this->tokenFunctions ] );
+   Hooks::run( 'APIQueryInfoTokens', [ $this->tokenFunctions ] );
 
return $this->tokenFunctions;
}
diff --git a/includes/api/ApiQueryRecentChanges.php 
b/includes/api/ApiQueryRecentChanges.php
index 8d14927..4ec2c28 100644
--- a/includes/api/ApiQueryRecentChanges.php
+++ b/includes/api/ApiQueryRecentChanges.php
@@ -65,7 +65,7 @@
$this->tokenFunctions = [
'patrol' => [ 'ApiQueryRecentChanges', 'getPatrolToken' 
]
];
-   Hooks::run( 'APIQueryRecentChangesTokens', [ 
&$this->tokenFunctions ] );
+   Hooks::run( 'APIQueryRecentChangesTokens', [ 
$this->tokenFunctions ] );
 
return $this->tokenFunctions;
}
diff --git a/includes/api/ApiQueryRevisions.php 
b/includes/api/ApiQueryRevisions.php
index 48f6046..eeed1fc 100644
--- a/includes/api/ApiQueryRevisions.php
+++ b/includes/api/ApiQueryRevisions.php
@@ -62,7 +62,7 @@
$this->tokenFunctions = [
'rollback' => [ 'ApiQueryRevisions', 'getRollbackToken' 
]
];
-   Hooks::run( 'APIQueryRevisionsTokens', [ &$this->tokenFunctions 
] );
+   Hooks::run( 'APIQueryRevisionsTokens', [ $this->tokenFunctions 
] );
 
return $this->tokenFunctions;
}
diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php
index 2d620a4..808ce89 100644
--- a/includes/api/ApiQueryUsers.php
+++ b/includes/api/ApiQueryUsers.php
@@ -78,7 +78,7 @@
$this->tokenFunctions = [
'userrights' => [ 'ApiQueryUsers', 'getUserrightsToken' 
],
];
-   Hooks::run( 'APIQueryUsersTokens', [ &$this->tokenFunctions ] );
+   Hooks::run( 'APIQueryUsersTokens', [ $this->tokenFunctions ] );
 
return $this->tokenFunctions;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78ea04a01ecce82294837e92c2a05b00ffb6e0f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Added null newsletter check

2016-12-19 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328211 )

Change subject: Added null newsletter check
..

Added null newsletter check

Added Exception, when newsletter is undefined.

Bug: T153529
Change-Id: I2a7269f4856a89c9b6062e6129805062d0df7853
---
M includes/content/NewsletterContent.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/11/328211/1

diff --git a/includes/content/NewsletterContent.php 
b/includes/content/NewsletterContent.php
index fef413b..0724298 100644
--- a/includes/content/NewsletterContent.php
+++ b/includes/content/NewsletterContent.php
@@ -127,6 +127,9 @@
$this->decode();
 
$this->newsletter = Newsletter::newFromName( 
$title->getText() );
+   if ( !$this->newsletter ) {
+   throw new MWException( 'Cannot find newsletter 
with name \"' + $title->getText() + '\"' );
+   }
$user = $options->getUser();
 
$newsletterActionButtons = 
$this->getNewsletterActionButtons( $options );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a7269f4856a89c9b6062e6129805062d0df7853
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Added ability to move newsletter

2016-12-19 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328178 )

Change subject: Added ability to move newsletter
..

Added ability to move newsletter

Fixed errors when trying to move newsletter, by adding "TitleMove" hook 
subscriber.

Bug: T153529
Change-Id: I174add6705c968f4ec03aae66e660546cdabd684
---
M Newsletter.hooks.php
M extension.json
2 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/78/328178/1

diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php
index 3fd23d4..a96c951 100755
--- a/Newsletter.hooks.php
+++ b/Newsletter.hooks.php
@@ -230,4 +230,16 @@
// Show error message and allow resubmitting in case of failure
return Status::newFatal( 'newsletter-restore-failure', 
$newsletterName );
}
+
+   /**
+* @param Title $title
+* @param Title $newtitle
+* @param User $user
+* @return bool
+*/
+   public static function onTitleMove( Title $title, Title 
$newtitle, User $user ) {
+   $newsletter = Newsletter::newFromName( 
$title->getText() );
+   NewsletterStore::getDefaultInstance()->updateName( 
$newsletter->getId(), $newtitle->getText() );
+   return true;
+   }
 }
diff --git a/extension.json b/extension.json
index c98a207..e972f39 100644
--- a/extension.json
+++ b/extension.json
@@ -150,6 +150,9 @@
],
"UndeleteForm::undelete": [
"NewsletterHooks::onUndeleteForm"
+   ],
+   "TitleMove": [
+   "NewsletterHooks::onTitleMove"
]
},
"namespaces": [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I174add6705c968f4ec03aae66e660546cdabd684
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Subscribe button now shows to Anonymous user

2016-12-18 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328048 )

Change subject: Subscribe button now shows to Anonymous user
..

Subscribe button now shows to Anonymous user

Show subscribe button to anonymous user, and redirect to login page. Thats 
alternative for 328041

Bug: T150637
Change-Id: Ifeaa0c045b5f5dee947c2c02a7c640be2e0ae4c4
---
M includes/content/NewsletterContent.php
1 file changed, 4 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/48/328048/1

diff --git a/includes/content/NewsletterContent.php 
b/includes/content/NewsletterContent.php
index 61ce83b..bcb18c0 100644
--- a/includes/content/NewsletterContent.php
+++ b/includes/content/NewsletterContent.php
@@ -129,12 +129,7 @@
$this->newsletter = Newsletter::newFromName( 
$title->getText() );
$user = $options->getUser();
 
-   $newsletterActionButtons = '';
-
-   if ( $user->isLoggedIn() ) {
-   // buttons are only shown for logged-in users
-   $newsletterActionButtons = 
$this->getNewsletterActionButtons( $options );
-   }
+   $newsletterActionButtons = 
$this->getNewsletterActionButtons( $options );
 
$mainTitle = Title::newFromText( $this->mainPage );
 
@@ -211,12 +206,8 @@
$form->suppressDefaultSubmit();
$form->prepareForm();
 
-   if ( $options->getUser()->isLoggedIn() ) {
-   $output->setText( $this->getNavigationLinks( 
$options ) . $newsletterActionButtons .
-   "" . $form->getBody() );
-   } else {
-   $output->setText( $this->getNavigationLinks( 
$options ) . $form->getBody() );
-   }
+   $output->setText( $this->getNavigationLinks( $options ) 
. $newsletterActionButtons .
+   "" . $form->getBody() );
return $output;
}
}
@@ -450,4 +441,4 @@
 
return $truncatedtext;
}
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifeaa0c045b5f5dee947c2c02a7c640be2e0ae4c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Added anonymous user warning message

2016-12-18 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328041 )

Change subject: Added anonymous user warning message
..

Added anonymous user warning message

Added warning for anonymous user for Special:Newsletters and Newsletter

Bug: T150637
Change-Id: Idc98d1fb68a0b5bf1f0f3aedebebaddaf30934a2
---
M i18n/en.json
M i18n/qqq.json
M includes/content/NewsletterContent.php
M includes/specials/SpecialNewsletters.php
4 files changed, 30 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/41/328041/1

diff --git a/i18n/en.json b/i18n/en.json
index b94d4f5..a52008f 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -66,6 +66,7 @@
"newsletter-manage-newsletter-success": "The newsletter have been 
modified.",
"newsletter-manage-newsletter-nochanges": "No changes were made to the 
existing newsletter.",
"newsletter-manage-summary": "Summary of the change:",
+   "newsletter-user-anon": "You need to be logged in in 
order to subscribe to newsletters",
"newsletter-delete": "Delete newsletter",
"newsletter-delete-failure": "\"$1\" newsletter could not be deleted. 
Please try again.",
"newsletter-subscribe": "Newsletter subscription management",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index c419efb..bfce75b 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -73,6 +73,7 @@
"newsletter-manage-newsletter-success": "Success message shown on 
Special:Newsletter's manage form when the publishers have been modfied.",
"newsletter-manage-newsletter-nochanges": "Message shown on 
Special:Newsletter if no changes were made to the existing publishers' list.",
"newsletter-manage-summary": "Edit summary for updating fields in 
Special:Newsletter's manage form",
+   "newsletter-user-anon": "Warning message shown when user is not 
logged-in",
"newsletter-delete": "Header message shown on 
Special:Newsletter//delete.\n\nSee also:\n* 
{{msg-mw|newsletter-view}}\n*{{msg-mw|newsletter-subscribe}}",
"newsletter-delete-failure": "Error message shown on 
Special:Newsletter//delete when the newsletter deletion 
fails.\n\nParameters:\n* $1 - Newsletter name",
"newsletter-subscribe": "Header message shown on 
Special:Newsletter//subscribe.\n\nSee also:\n* 
{{msg-mw|newsletter-delete}}\n*{{msg-mw|newsletter-view}}",
diff --git a/includes/content/NewsletterContent.php 
b/includes/content/NewsletterContent.php
index 61ce83b..ee45b0c 100644
--- a/includes/content/NewsletterContent.php
+++ b/includes/content/NewsletterContent.php
@@ -130,11 +130,24 @@
$user = $options->getUser();
 
$newsletterActionButtons = '';
+   $anonWarningText = '';
 
if ( $user->isLoggedIn() ) {
// buttons are only shown for logged-in users
$newsletterActionButtons = 
$this->getNewsletterActionButtons( $options );
+   } else {
+   $LoginTitle = SpecialPage::getTitleFor( 'Userlogin' );
+   $query = ['returnto' => $title->getPrefixedDBkey()];
+   $url = $LoginTitle->getFullURL( $query, false, 
PROTO_HTTPS );
+   $anonWarningText =
+   Html::rawElement(
+   'p',
+   array( 'class' => 'warning' ),
+   wfMessage( 'newsletter-user-anon', $url 
)->text()
+   );
}
+
+
 
$mainTitle = Title::newFromText( $this->mainPage );
 
@@ -215,7 +228,7 @@
$output->setText( $this->getNavigationLinks( 
$options ) . $newsletterActionButtons .
"" . $form->getBody() );
} else {
-   $output->setText( $this->getNavigationLinks( 
$options ) . $form->getBody() );
+   $output->setText( $this->getNavigationLinks( 
$options ) . $anonWarningText . $form->getBody() );
}
return $output;
}
@@ -450,4 +463,4 @@
 
return $truncatedtext;
}
-}
\ No newline at end of file
+}
diff --git a/includes/specials/SpecialNewsletters.php 
b/includes/specials/SpecialNewsletters.php
index 27b3b91..21589c5 100644
--- a/includes/specials/SpecialNewsletters.php
+++ b/includes/specials/SpecialNewsletters.php
@@ -24,6 +24,19 @@
$out->addModuleStyles( 'ext.newsletter.newsletters.styles' );
$user = $this->getUser();
 
+   if ( $user->isAnon() ) {
+   $title = SpecialPage::getTitleFor( 'Userlogin' );
+

[MediaWiki-commits] [Gerrit] mediawiki...Checkpoint[master]: Replaced usage of deprecated hook "ArticleSave"

2016-12-16 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327771 )

Change subject: Replaced usage of deprecated hook "ArticleSave"
..

Replaced usage of deprecated hook "ArticleSave"

Replaced usage of deprecated hook "ArticleSave" deprecated in
MediaWiki 1.21, with "PageContentSave"

Bug: T151973
Change-Id: Ied84aeb0821a873bf3b9be56a9ed12f6fd67c318
---
M Checkpoint.php
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Checkpoint 
refs/changes/71/327771/1

diff --git a/Checkpoint.php b/Checkpoint.php
index ccc49aa..0931b4b 100644
--- a/Checkpoint.php
+++ b/Checkpoint.php
@@ -23,7 +23,7 @@
 $wgExtensionMessagesFiles['Checkpoint'] = dirname( __FILE__ ) . 
'/Checkpoint.i18n.php';
 
 $wgHooks['EditPageBeforeEditButtons'][] = 'efCheckpointButton';
-$wgHooks['ArticleSave'][] = 'efCheckpointSave';
+$wgHooks['PageContentSave'][] = 'efCheckpointSave';
 $wgHooks['GetFullURL'][] = 'efCheckpointReturn';
 
 function efCheckpointButton( &$editpage, &$buttons ) {
@@ -38,7 +38,8 @@
return true;
 }
 
-function efCheckpointSave( $article, $user, $text, &$summary, $minor, $watch, 
$sectionanchor, $flags ) {
+function efCheckpointSave( &$wikiPage, &$user, &$content, &$summary,
+   $isMinor, $isWatch, $section, &$flags, &$status ) {
global $wgRequest;
 
if ( $wgRequest->getCheck( 'wpCheckpoint' ) ) {
@@ -46,8 +47,8 @@
// blank summary, so let's get an automatic one if
// applicable (the appending bit prevents autosummaries
// from appearing otherwise).
-   $oldtext = $article->getContent( Revision::RAW ); // 
current revision
-   $summary = $article->getAutosummary( $oldtext, $text, 
$flags );
+   $old_content = $wikiPage->getContent( Revision::RAW ); 
// current revision
+   $summary = 
$wikiPage->getContentHandler()->getAutosummary( $oldtext, $text, $flags );
}
$summary .= wfMessage( 'word-separator' )->text() . wfMessage( 
'checkpoint-notice' )->text();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied84aeb0821a873bf3b9be56a9ed12f6fd67c318
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Checkpoint
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...LiveTranslate[master]: Replaced deprecated hook "$wgHooks['ArticleSaveComplete'][]"

2016-12-15 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327585 )

Change subject: Replaced deprecated hook "$wgHooks['ArticleSaveComplete'][]"
..

Replaced deprecated hook "$wgHooks['ArticleSaveComplete'][]"

Replaced hook "$wgHooks['ArticleSaveComplete'][]" deprecated in MediaWiki 1.21, 
with "$wgHooks['PageContentSaveComplete']"

Bug: T151973
Change-Id: If2f685b8bcfca4b4a3bc4dab99d82047b1a38f13
---
M LiveTranslate.hooks.php
M LiveTranslate.php
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiveTranslate 
refs/changes/85/327585/1

diff --git a/LiveTranslate.hooks.php b/LiveTranslate.hooks.php
index 70967de..058e66e 100644
--- a/LiveTranslate.hooks.php
+++ b/LiveTranslate.hooks.php
@@ -275,8 +275,8 @@
 *
 * @return true
 */
-   public static function onArticleSaveComplete( &$article, &$user, $text, 
$summary,
-   $minoredit, $watchthis, $sectionanchor, &$flags, $revision, 
&$status, $baseRevId, &$redirect = null ) {
+   public static function onPageContentSaveComplete( $wikiPage, $user, 
$content, $summary,
+   $isMinor, $isWatch, $section, $flags, $revision ) {
 
$title = $article->getTitle();
 
diff --git a/LiveTranslate.php b/LiveTranslate.php
index 4fd5b31..cff39c3 100644
--- a/LiveTranslate.php
+++ b/LiveTranslate.php
@@ -74,7 +74,7 @@
 
 $wgHooks['ArticleViewHeader'][] = 'LiveTranslateHooks::onArticleViewHeader';
 $wgHooks['LoadExtensionSchemaUpdates'][] = 
'LiveTranslateHooks::onSchemaUpdate';
-$wgHooks['ArticleSaveComplete'][] = 
'LiveTranslateHooks::onArticleSaveComplete';
+$wgHooks['PageContentSaveComplete'][] = 
'LiveTranslateHooks::onPageContentSaveComplete';
 $wgHooks['InternalParseBeforeLinks'][] = 'LiveTranslateHooks::stripMagicWords';
 $wgHooks['OutputPageParserOutput'][] = 
'LiveTranslateHooks::onOutputPageParserOutput';
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2f685b8bcfca4b4a3bc4dab99d82047b1a38f13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiveTranslate
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...InterwikiIntegration[master]: Replaced deprecated hook "$wgHooks['ArticleInsertComplete'][]"

2016-12-15 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327583 )

Change subject: Replaced deprecated hook "$wgHooks['ArticleInsertComplete'][]"
..

Replaced deprecated hook "$wgHooks['ArticleInsertComplete'][]"

Replaced hook "$wgHooks['ArticleInsertComplete'][]" and 
"$wgHooks['ArticleSaveComplete'][]" deprecated in MediaWiki 1.21, with 
"$wgHooks['PageContentInsertComplete']" and 
"$wgHooks['PageContentInsertComplete'][]"

Bug: T151973
Change-Id: I453c9cd5443b38c5620249d344c055f28a150859
---
M InterwikiIntegration.hooks.php
M InterwikiIntegration.php
2 files changed, 37 insertions(+), 37 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/InterwikiIntegration 
refs/changes/83/327583/1

diff --git a/InterwikiIntegration.hooks.php b/InterwikiIntegration.hooks.php
index c479610..88266ca 100644
--- a/InterwikiIntegration.hooks.php
+++ b/InterwikiIntegration.hooks.php
@@ -1,5 +1,5 @@
  $wgDBname
)
);
-   
+
$existing = array();
while ( $row = $mDb->fetchObject( $res ) ) {
if ( !isset( $existing[$row->integration_iwl_prefix] ) 
) {
@@ -67,7 +67,7 @@
}

$existing[$row->integration_iwl_prefix][$row->integration_iwl_title] = 1;
}
-   
+
$del = array();
foreach ( $existing as $prefix => $dbkeys ) {
if ( isset( $mInterwikis[$prefix] ) ) {
@@ -76,7 +76,7 @@
$del[$prefix] = $existing[$prefix];
}
}
-   
+
$ins = array();
foreach( $mInterwikis as $prefix => $dbkeys ) {
# array_diff_key() was introduced in PHP 5.1, there is 
a compatibility function
@@ -124,18 +124,18 @@
}
return true;
}
-   
+
/**
 * When a page is created, purge caches of pages that link to it 
interwiki
 */
-   public static function InterwikiIntegrationArticleInsertComplete ( 
&$article, &$user, $text, $summary, $minoredit, 
-   &$watchthis, $sectionanchor, &$flags, $revision ) {
+   public static function InterwikiIntegrationPageContentInsertComplete ( 
$wikiPage, $user, $content, $summary,
+$isMinor, $isWatch, $section, $flags, $revision ) {
global $wgDBname;
$mDb = wfGetDB( DB_MASTER );
$result = $mDb->selectrow(
'page',
'*',
-   array ('page_id' => $article->getID() )
+   array ('page_id' => $wikiPage->getID() )
);
foreach ( $result as $key => $value ) {
$newKey = "integration_" . $key;
@@ -143,10 +143,10 @@
}
$iPage['integration_page_db'] = $wgDBname;
$mDb->insert( 'integration_page', $iPage );
-   InterwikiIntegrationHooks::PurgeReferringPages ( 
$article->getTitle() );
+   InterwikiIntegrationHooks::PurgeReferringPages ( 
$wikiPage->getTitle() );
return true;
}
-   
+
/**
 * When a page is deleted, purge caches of pages that link to it 
interwiki
 */
@@ -168,7 +168,7 @@
);
return true;
}
-   
+
/**
 * When a page is undeleted, purge caches of pages that link to it 
interwiki
 */
@@ -191,9 +191,9 @@
}
return true;
}
-   
-   public static function InterwikiIntegrationArticleSaveComplete( 
&$article, &$user, $text, $summary,
-   $minoredit, $watchthis, $sectionanchor, &$flags, $revision, 
&$status, $baseRevId, &$redirect ) {
+
+   public static function InterwikiIntegrationPageContentSaveComplete( 
$article, $user, $content, $summary,
+$isMinor, $isWatch, $section, $flags, $revision, $status, $baseRevId ) {
global $wgDBname;
if ( !is_null ( $revision ) ) {
$mDb = wfGetDB( DB_MASTER );
@@ -227,7 +227,7 @@
InterwikiIntegrationHooks::PurgeReferringPages ( $title );
return true;
}
-   
+
/**
 * When a page is blanked, purge caches of pages that link to the new 
page interwiki.
 * This is called by a PureWikiDeletion hook.
@@ -236,7 +236,7 @@
InterwikiIntegrationHooks::PurgeReferringPages ( $title );
return true;
}
-   
+
/**
 * When a page is unblanked, purge caches of pages that link to the new 
page interwiki.
 * This is called by a PureWikiDeletion hook.
@@ -245,20 +245,20 @@

[MediaWiki-commits] [Gerrit] mediawiki...IndexFunction[master]: Replaced deprecated hook "$wgHooks['ArticleInsertComplete'][]"

2016-12-15 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327581 )

Change subject: Replaced deprecated hook "$wgHooks['ArticleInsertComplete'][]"
..

Replaced deprecated hook "$wgHooks['ArticleInsertComplete'][]"

Replaced hook "$wgHooks['ArticleInsertComplete'][]" deprecated in MediaWiki 
1.21, with "$wgHooks['PageContentInsertComplete']"

Bug: T151973
Change-Id: I94404f49feaf1ef293cb3258ede5a9ff170ddced
---
M IndexFunction.php
M IndexFunction_body.php
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/IndexFunction 
refs/changes/81/327581/1

diff --git a/IndexFunction.php b/IndexFunction.php
index 387be0d..385f681 100644
--- a/IndexFunction.php
+++ b/IndexFunction.php
@@ -24,7 +24,7 @@
 # Remove things from the index table when a page is deleted
 $wgHooks['ArticleDeleteComplete'][] = 'IndexFunctionHooks::onDelete';
 # Remove things from the index table when creating a new page
-$wgHooks['ArticleInsertComplete'][] = 'IndexFunctionHooks::onCreate';
+$wgHooks['PageContentInsertComplete'][] = 'IndexFunctionHooks::onCreate';
 # Show a warning when editing an index title
 $wgHooks['EditPage::showEditForm:initial'][] = 
'IndexFunctionHooks::editWarning';
 # Show a warning after page move, and do some cleanup
diff --git a/IndexFunction_body.php b/IndexFunction_body.php
index b9ef039..7f3a499 100644
--- a/IndexFunction_body.php
+++ b/IndexFunction_body.php
@@ -310,9 +310,9 @@
return true;
}
 
-   // When creating an article, delete its title from the index table
-   static function onCreate( &$article, &$user, $text, $summary, 
$minoredit, $watchthis, $sectionanchor, &$flags, $revision ) {
-   $t = $article->mTitle;
+   // When creating an page, delete its title from the index table
+   static function onCreate($wikiPage, $user, $content, $summary, 
$isMinor,$isWatch, $section, $flags,$revision) {
+   $t = $wikiPage->getTitle();
$ns = $t->getNamespace();
$dbkey = $t->getDBkey();
$dbw = wfGetDB( DB_MASTER );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94404f49feaf1ef293cb3258ede5a9ff170ddced
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/IndexFunction
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikiArticleFeeds[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-14 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327308 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced content object creation by "ContentHandler" with "->getContentObject" 
call

Bug: T151973
Change-Id: I0772cf525bf104aa2ce79e13074dfe25346f3b6a
---
M WikiArticleFeeds_body.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiArticleFeeds 
refs/changes/08/327308/1

diff --git a/WikiArticleFeeds_body.php b/WikiArticleFeeds_body.php
index 3fa4387..9e3259e 100644
--- a/WikiArticleFeeds_body.php
+++ b/WikiArticleFeeds_body.php
@@ -304,8 +304,7 @@
 
# Setup, handle redirects
if ( $article->isRedirect() ) {
-   $rtitle = ContentHandler::makeContent( 
$article->getContent(), null, CONTENT_MODEL_WIKITEXT )
-   ->getRedirectTarget();
+   $rtitle = 
$article->getContentObject()->getRedirectTarget();
if ( $rtitle ) {
$article = new Article( $rtitle );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0772cf525bf104aa2ce79e13074dfe25346f3b6a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiArticleFeeds
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SocialProfile[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-14 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327305 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage"

Bug: T151973
Change-Id: I0969712ddae9341d6ba88e9aa88f6f1a84b90064
---
M UserProfile/SpecialToggleUserPageType.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialProfile 
refs/changes/05/327305/1

diff --git a/UserProfile/SpecialToggleUserPageType.php 
b/UserProfile/SpecialToggleUserPageType.php
index 30917fd..c7dadb9 100644
--- a/UserProfile/SpecialToggleUserPageType.php
+++ b/UserProfile/SpecialToggleUserPageType.php
@@ -77,8 +77,8 @@
 
if ( $user_page_type == 1 && !$user->isBlocked() ) {
$user_page = Title::makeTitle( NS_USER, 
$user->getName() );
-   $article = new Article( $user_page );
-   $user_page_content = $article->getContent();
+   $page = new WikiPage( $user_page );
+   $user_page_content = 
$page->getContent()->getNativeData();
 
$user_wiki_title = Title::makeTitle( NS_USER_WIKI, 
$user->getName() );
$user_wiki = new Article( $user_wiki_title );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0969712ddae9341d6ba88e9aa88f6f1a84b90064
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SocialProfile
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Widgets[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-14 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327303 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage"

Bug: T151973
Change-Id: I94a1850a05340b90c1f60d9411f52addabab65a7
---
M WidgetRenderer.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Widgets 
refs/changes/03/327303/1

diff --git a/WidgetRenderer.php b/WidgetRenderer.php
index 9b47099..b8c95ff 100644
--- a/WidgetRenderer.php
+++ b/WidgetRenderer.php
@@ -172,8 +172,8 @@
$widgetCode = '';
}
} else {
-   $widgetArticle = new Article( $widgetTitle, 0 );
-   $widgetCode = $widgetArticle->getContent();
+   $widgetPage = new WikiPage( $widgetTitle );
+   $widgetCode = 
$widgetPage->getContent()->getNativeData();
}
 
// Remove  sections and  tags 
from form definition

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94a1850a05340b90c1f60d9411f52addabab65a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Widgets
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SimpleSecurity[master]: "Article::getContent()" is deprecated in MediaWiki 1.21

2016-12-14 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327298 )

Change subject: "Article::getContent()" is deprecated in MediaWiki 1.21
..

"Article::getContent()" is deprecated in MediaWiki 1.21

Replaced "Article::getContent()" usage

Bug: T151973
Change-Id: I0fba699b211baacdeaceeb20aa6c39d85339248e
---
M SimpleSecurity_body.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SimpleSecurity 
refs/changes/98/327298/1

diff --git a/SimpleSecurity_body.php b/SimpleSecurity_body.php
index c7fccd8..7726ce1 100644
--- a/SimpleSecurity_body.php
+++ b/SimpleSecurity_body.php
@@ -48,7 +48,8 @@
# Add extra available groups if $wgSecurityGroupsArticle is set
if ( $wgSecurityGroupsArticle ) {
$groups = new Article( Title::newFromText( 
$wgSecurityGroupsArticle, NS_MEDIAWIKI ) );
-   if ( preg_match_all( "/^\*?\s*(.+?)\s*(\|\s*(.+))?$/m", 
$groups->getContent(), $match ) ) {
+   $groupsContent = $groups->getContentObject();
+   if ( preg_match_all( "/^\*?\s*(.+?)\s*(\|\s*(.+))?$/m", 
ContentHandler::getContentText( $groupsContent ), $match ) ) {
foreach( $match[1] as $i => $k ) {
$v = $match[3][$i];
if ( $v ) 
$wgSecurityExtraGroups[strtolower( $k )] = $v;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0fba699b211baacdeaceeb20aa6c39d85339248e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SimpleSecurity
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SpamDiffTool[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-14 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327295 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" usage, and replace "Article" with "WikiPage" in one place

Bug: T151973
Change-Id: Ice9f02e42bd1bb5ffd4a86d5ca864a03f0c34241
---
M SpamDiffTool.body.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SpamDiffTool 
refs/changes/95/327295/1

diff --git a/SpamDiffTool.body.php b/SpamDiffTool.body.php
index 05b910d..9205084 100644
--- a/SpamDiffTool.body.php
+++ b/SpamDiffTool.body.php
@@ -79,7 +79,8 @@
if ( $request->wasPosted() ) {
if ( $request->getCheck( 'confirm' ) ) {
$a = new Article( $sb );
-   $text = $a->getContent();
+   $acontent = $a->getContentObject();
+   $text = ContentHandler::getContentText( 
$acontent );
$blacklistPageId = $a->getId();
 
// If the blacklist page doesn't exist yet, use 
the interface
@@ -258,8 +259,8 @@
}
} else {
if ( $title != '' ) {
-   $a = new Article( $title );
-   $text = $a->getContent( true );
+   $page = new WikiPage( $title );
+   $text = $page->getContent()->getNativeData();
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice9f02e42bd1bb5ffd4a86d5ca864a03f0c34241
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SpamDiffTool
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikilog[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-14 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327289 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage"

Bug: T151973
Change-Id: Ic876258dba56921adf0b124f9f79762d86fbc926
---
M SpecialWikilog.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikilog 
refs/changes/89/327289/1

diff --git a/SpecialWikilog.php b/SpecialWikilog.php
index 2310bfb..feaca37 100644
--- a/SpecialWikilog.php
+++ b/SpecialWikilog.php
@@ -166,8 +166,8 @@
$title = $query->getWikilogTitle();
if ( !is_null( $title ) ) {
# Retrieve wikilog front page
-   $article = new Article( $title );
-   $content = $article->getContent();
+   $page = new WikiPage( $title );
+   $content = $page->getContent()->getNativeData();
$wgOut->setPageTitle( $title->getPrefixedText() 
);
$wgOut->addWikiTextTitle( $content, $title );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic876258dba56921adf0b124f9f79762d86fbc926
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikilog
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...JsonData[master]: Replaced "Revision::getText()" depracated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326524 )

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
..

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: Ia822612602ce06cc915e339e02f2bd66e3ff433b
---
M JsonData_body.php
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JsonData 
refs/changes/24/326524/1

diff --git a/JsonData_body.php b/JsonData_body.php
index 5343435..c09f842 100644
--- a/JsonData_body.php
+++ b/JsonData_body.php
@@ -141,20 +141,21 @@
}
 
/*
-* Load appropriate editor text into the object (if it hasn't been 
yet), 
+* Load appropriate editor text into the object (if it hasn't been yet),
 * and return it.  This will either be the contents of the title being
 * viewed, or it will be the newly-edited text being previewed.
 */
public function getEditorText() {
if( is_null( $this->editortext ) ) {
-   // on preview, pull $editortext out from the submitted 
text, so 
+   // on preview, pull $editortext out from the submitted 
text, so
// that the author can change schemas during preview
$this->editortext = $this->out->getRequest()->getText( 
'wpTextbox1' );
// wpTextbox1 is empty in normal editing, so pull it 
from article->getText() instead
if ( empty( $this->editortext ) ) {
$rev = Revision::newFromTitle( $this->title );
if( is_object( $rev ) ) {
-   $this->editortext = $rev->getText();
+   $content = $rev->getContent();
+   $this->editortext = 
ContentHandler::getContentText( $content );
}
else {
$this->editortext = "";
@@ -284,7 +285,7 @@
}
 
/*
-*  Parse the article/editor text as well as the corresponding schema 
text, 
+*  Parse the article/editor text as well as the corresponding schema 
text,
 *  and load the result into an object (JsonTreeRef) that associates
 *  each JSON node with its corresponding schema node.
 */
@@ -312,7 +313,8 @@
return "";
}
else {
-   $revtext = $rev->getText();
+   $content = $rev->getContent();
+   $revtext = ContentHandler::getContentText( $contet );
return preg_replace( array( '/^<[\w]+[^>]*>/m', 
'/<\/[\w]+>$/m' ), array( "", "" ), $revtext );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia822612602ce06cc915e339e02f2bd66e3ff433b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/JsonData
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...ConfirmEdit[master]: Replaced "Revision::getText()" depracated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326525 )

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
..

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: I91f93341ac642327657f888ebda7ff9d33f428bf
---
M SimpleCaptcha/Captcha.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ConfirmEdit 
refs/changes/25/326525/1

diff --git a/SimpleCaptcha/Captcha.php b/SimpleCaptcha/Captcha.php
index feaed4b..76568d5 100644
--- a/SimpleCaptcha/Captcha.php
+++ b/SimpleCaptcha/Captcha.php
@@ -1233,10 +1233,11 @@
 */
function loadText( $title, $section, $flags = Revision::READ_LATEST ) {
$rev = Revision::newFromTitle( $title, false, $flags );
+   $content = $rev->getContent();
if ( is_null( $rev ) ) {
return "";
} else {
-   $text = $rev->getText();
+   $text = ContentHandler::getContentText( $content );
if ( $section != '' ) {
global $wgParser;
return $wgParser->getSection( $text, $section );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91f93341ac642327657f888ebda7ff9d33f428bf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Replaced "Revision::getText()" depracated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326523 )

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
..

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: I6f29d8e465ecff3aed32498746054e82b4a5d2ff
---
M includes/PF_FormUtils.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/23/326523/1

diff --git a/includes/PF_FormUtils.php b/includes/PF_FormUtils.php
index e8c6e73..c00ab17 100644
--- a/includes/PF_FormUtils.php
+++ b/includes/PF_FormUtils.php
@@ -305,7 +305,8 @@
if ( isset( $preloadTitle ) && $preloadTitle->userCan( 
'read' ) ) {
$rev = Revision::newFromTitle( $preloadTitle );
if ( is_object( $rev ) ) {
-   $text = $rev->getText();
+   $content = $rev->getContent();
+   $text = ContentHandler::getContentText( 
$content );
// Remove  sections and 
 tags from text
$text = StringUtils::delimiterReplace( 
'', '', '', $text );
$text = strtr( $text, array( 
'' => '', '' => '' ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f29d8e465ecff3aed32498746054e82b4a5d2ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...PopupPages[master]: Replaced "Revision::getText()" depracated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326522 )

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
..

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: I3105bf0eab6b1268c3269dd85c940fec33e5227e
---
M PopupPages.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PopupPages 
refs/changes/22/326522/1

diff --git a/PopupPages.php b/PopupPages.php
index e1a9ba3..30d4ef6 100644
--- a/PopupPages.php
+++ b/PopupPages.php
@@ -127,7 +127,8 @@
  }
  $article = Revision::newFromTitle( $title );
  if( isset($article) ) {
- $raw = $article->getText(Revision::FOR_PUBLIC);
+ $content = $article->getContent( Revision::FOR_PUBLIC );
+ $raw = ContentHandler::getContentText( $content );
  $parsed = $parser->parse( $raw, $parser->mTitle, new 
ParserOptions() );
  $body = '' . $parsed->getText() . '';
  } else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3105bf0eab6b1268c3269dd85c940fec33e5227e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PopupPages
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SpamDiffTool[master]: Replaced "Revision::getText()" depracated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326509 )

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
..

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: I83f030e6628534d9b76fbd4f8ece9833de8f39ac
---
M SpamDiffTool.body.php
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SpamDiffTool 
refs/changes/09/326509/1

diff --git a/SpamDiffTool.body.php b/SpamDiffTool.body.php
index 1651e55..05b910d 100644
--- a/SpamDiffTool.body.php
+++ b/SpamDiffTool.body.php
@@ -242,8 +242,10 @@
 
$de = new DifferenceEngine( $title, $oldid, $diff, 
$rcid );
$de->loadText();
-   $otext = $de->mOldRev->getText();
-   $ntext = $de->mNewRev->getText();
+   $ocontent = $de->$mOldRev->getContent();
+   $ncontent = $de->$mNewRev->getContent();
+   $otext = ContentHandler::getContentText( $ocontent );
+   $ntext = ContentHandler::getContentText( $ncontent );
$ota = explode( "\n", $wgContLang->segmentForDiff( 
$otext ) );
$nta = explode( "\n", $wgContLang->segmentForDiff( 
$ntext ) );
$diffs = new Diff( $ota, $nta );
@@ -316,4 +318,4 @@
);
}
 
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83f030e6628534d9b76fbd4f8ece9833de8f39ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SpamDiffTool
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Premoderation[master]: Replaced "Revision::getText()" depracated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326521 )

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
..

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: Ie50fa94709c46d1f21ab65199a58b0aaa9a049af
---
M SpecialPremoderation.php
1 file changed, 77 insertions(+), 76 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Premoderation 
refs/changes/21/326521/1

diff --git a/SpecialPremoderation.php b/SpecialPremoderation.php
index e334a90..46b5c01 100644
--- a/SpecialPremoderation.php
+++ b/SpecialPremoderation.php
@@ -5,11 +5,11 @@
protected $mRequest = array();
protected $mSummary = '';
public $mAllowedStatus = array( 'new', 'approved', 'declined' );
-   
+
function __construct() {
global $wgRequest;
parent::__construct( 'Premoderation', 'premoderation' );
-   
+
if( $wgRequest->wasPosted() ) {
$this->mPosted = true;
$this->mRequest = $wgRequest->getValues();
@@ -22,7 +22,7 @@
 
public function execute( $subpage ) {
global $wgUser, $wgOut;
-   
+
if( !$wgUser->isAllowed( 'premoderation' ) ) {
$this->displayRestrictionError();
return;
@@ -34,44 +34,44 @@
if( $wgUser->isBlocked() ) {
throw new UserBlockedError( 
$this->getUser()->getBlock() );
}
-   
+
$params = array_values( explode( '/', $subpage ) );
$action = array_shift( $params );
-   
+
if( $action == '' ) {
$action = 'list';
} elseif( isset( $params ) ) {
$this->mParams = Premoderation::formatParams( $params );
}
-   
+
switch( $action ) {
case 'list':
$this->showList();
break;
-   
+
case 'status':
( $this->mPosted ) ? $this->performChanges() : 
$this->statusInterface();
break;
-   
+
default:
$wgOut->setPageTitle( $this->msg( 
'premoderation-manager-invalidaction' ) );
$wgOut->addWikiMsg( 
'premoderation-invalidaction' );
}
}
-   
+
protected function showList() {
global $wgOut, $wgArticlePath;
-   
+
$wgOut->setPageTitle( $this->msg( 
'premoderation-manager-mainpage' ) );
$wgOut->addWikiMsg( 'premoderation-list-intro' );
-   
+
$dbr = wfGetDB( DB_SLAVE );
$params = $this->mParams;
$conds = 'pmq_status <> "approved"';
if( isset( $params['offset'] ) ) {
$conds .= ' AND pmq_timestamp < ' . $dbr->addQuotes( 
$params['offset'] );
}
-   
+
$res = $dbr->select(
'pm_queue',
array(
@@ -83,7 +83,7 @@
__METHOD__,
array( 'ORDER BY' => 'pmq_timestamp DESC', 'LIMIT' => 
101 )
);
-   
+
$result = array();
for( $a = 0; $a < 101; $a++ ) {
$row = $dbr->fetchRow( $res );
@@ -97,39 +97,39 @@
$status = $row['pmq_status'];
$result[$status][] = $row;
}
-   
+
if( isset( $offset ) ) {
$wgOut->addHtml( Linker::link( $this->getPageTitle( 
"list/offset/$offset" ),
$this->msg( 'premoderation-next' )->escaped() ) 
);
}
-   
+
if( isset( $result['new'] ) ) {
$msg = $this->msg( 'premoderation-list-new-h2' 
)->text();
$wgOut->addWikiText( '' . $msg . '' );
-   
+
$output = $this->getListTableHeader( 'new' );
foreach( $result['new'] as $row ) {
$output .= $this->formatListTableRow( $row );
}
$output .= Xml::closeElement( 'table' );
-   
+
$wgOut->addHTML( $output );
}
-   
+
if( isset( $result['declined'] ) ) {
$msg = $this->msg( 

[MediaWiki-commits] [Gerrit] mediawiki...RandomImage[master]: Replaced "Revision::getText()" depracated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326511 )

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
..

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: I4593b9160664c9e7082945212bdfc116d93ccf97
---
M RandomImage.class.php
1 file changed, 17 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RandomImage 
refs/changes/11/326511/1

diff --git a/RandomImage.class.php b/RandomImage.class.php
index 013c015..5f1246d 100644
--- a/RandomImage.class.php
+++ b/RandomImage.class.php
@@ -10,13 +10,13 @@
 class RandomImage {
 
private $parser = null;
-   
+
private $width = false;
private $float = false;
private $caption = '';
-   
+
private $choices = array();
-   
+
/**
 * Constructor
 *
@@ -29,7 +29,7 @@
$this->caption = $caption;
$this->setOptions( $options );
}
-   
+
/**
 * Extract applicable options from tag attributes
 *
@@ -39,7 +39,7 @@
if( isset( $options['size'] ) ) {
$size = intval( $options['size'] );
if( $size > 0 )
-   $this->width = $size;   
+   $this->width = $size;
}
if( isset( $options['float'] ) ) {
$float = strtolower( $options['float'] );
@@ -53,7 +53,7 @@
$this->choices = $choices;
}
}
-   
+
/**
 * Render a random image
 *
@@ -62,7 +62,7 @@
public function render() {
$title = $this->pickImage();
if( $title instanceof Title && $this->imageExists( $title ) ) {
-   return $this->removeMagnifier( 
+   return $this->removeMagnifier(
$this->parser->recursiveTagParse(
$this->buildMarkup( $title )
)
@@ -70,7 +70,7 @@
}
return '';
}
-   
+
/**
 * Does the specified image exist?
 *
@@ -85,7 +85,7 @@
$file = wfFindFile( $title );
return is_object( $file ) && $file->exists();
}
-   
+
/**
 * Prepare image markup for the given image
 *
@@ -126,7 +126,8 @@
protected function getCaption( $title ) {
if( !$this->caption ) {
if( $title->exists() ) {
-   $text = Revision::newFromTitle( $title 
)->getText();
+   $content = Revision::newFromTitle( $title 
)->getContent();
+   $text = ContentHandler::getContentText( 
$content );
if( preg_match( 
'!(.*?)!i', $text, $matches ) ) {
$this->caption = $matches[1];
} elseif( preg_match( "!^(.*?)\n!i", $text, 
$matches ) ) {
@@ -160,7 +161,7 @@
return $pick;
}
}
-   
+
/**
 * Select a random image from the choices given
 *
@@ -172,7 +173,7 @@
: $this->choices[0];
return Title::makeTitleSafe( NS_FILE, $name );
}
-   
+
/**
 * Select a random image from the database
 *
@@ -207,7 +208,7 @@
}
return null;
}
-   
+
/**
 * Get various options for database selection
 *
@@ -236,7 +237,7 @@
);
}
}
-   
+
/**
 * Parser hook callback
 *
@@ -252,7 +253,7 @@
$random = new RandomImage( $parser, $args, $input );
return $random->render();
}
-   
+
/**
 * Strip  tags out of page text
 *
@@ -264,5 +265,5 @@
$text = preg_replace( '!!i', '', $text );
return true;
}
-   
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4593b9160664c9e7082945212bdfc116d93ccf97
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RandomImage
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMaintenance[master]: Replaced "Revision::getText()" depracated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326508 )

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
..

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: I8f5d756ee5b8e5c586816354e92f8f8889e64ce5
---
M cleanupMl.php
M migrateWlmUploads.php
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance 
refs/changes/08/326508/1

diff --git a/cleanupMl.php b/cleanupMl.php
index ea718b6..a12262a 100644
--- a/cleanupMl.php
+++ b/cleanupMl.php
@@ -45,7 +45,8 @@
echo "Does not exist: $line\n";
continue;
}
-   $text = $revision->getText();
+   $content = $revision->getContent();
+   $text = ContentHandler::getContentText( $content );
if ( $text === false ) {
echo "Cannot load text: $line\n";
continue;
diff --git a/migrateWlmUploads.php b/migrateWlmUploads.php
index 07e3ee2..e506034 100644
--- a/migrateWlmUploads.php
+++ b/migrateWlmUploads.php
@@ -150,7 +150,8 @@
 
$title = Title::makeTitle( NS_FILE, $fileName );
$rev = Revision::newFromTitle( $title, 0, Revision::READ_LATEST 
);
-   $text = $rev->getText() . "\n{{WLM image from testwiki}}";
+   $content = $rev->getContent();
+   $text = ContentHandler::getContentText( $content ) . "\n{{WLM 
image from testwiki}}";
$descFile = "{$this->tmpDir}/desc.txt";
 
// Because uploading directly to Commons requires manipulation 
with globals and other scary stuff,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f5d756ee5b8e5c586816354e92f8f8889e64ce5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikiObjectModel[master]: Replaced "Revision::getText()" depracated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326504 )

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
..

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: Ic04a96223231bd7843c9bc48b9325ce12bb41970
---
M includes/WOM_Processor.php
M includes/apis/WOM_OutputProcessor.php
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiObjectModel 
refs/changes/04/326504/1

diff --git a/includes/WOM_Processor.php b/includes/WOM_Processor.php
index 43c3e60..7dd04e9 100644
--- a/includes/WOM_Processor.php
+++ b/includes/WOM_Processor.php
@@ -419,7 +419,8 @@
if ( $revision == null ) {
throw new MWException( __METHOD__ . ": Page not exist 
'{$title} ({$rid})'" );
}
-   $content = $revision->getText();
+   $revisionContent = $revision->getContent();
+   $content = ContentHandler::getContentText( $revisionContent );
 
$wom = self::parseToWOM( $content );
$wom->setTitle( $title );
diff --git a/includes/apis/WOM_OutputProcessor.php 
b/includes/apis/WOM_OutputProcessor.php
index 0f12c46..f1c48d6 100644
--- a/includes/apis/WOM_OutputProcessor.php
+++ b/includes/apis/WOM_OutputProcessor.php
@@ -163,7 +163,8 @@
if ( $revision === NULL ) {
throw new MWException( __METHOD__ . ": Page not exist 
'{$page_name} ({$rid})'" );
}
-   $text = $revision->getText();
+   $content = $revision->getContent();
+   $text = ContentHandler::getContentText( $content );
$wom = WOMProcessor::parseToWOM( $text );
 
global $wgOMOutputHookedParserFunctions;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic04a96223231bd7843c9bc48b9325ce12bb41970
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiObjectModel
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...News[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326467 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

"Article::getContent" is deprecated - replaced usage

Bug: T151973
Change-Id: I1a0009d877281b2300ce31ac4afaecac005e91d8
---
M NewsRenderer.php
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/News 
refs/changes/67/326467/1

diff --git a/NewsRenderer.php b/NewsRenderer.php
index 254d8e3..e8da045 100644
--- a/NewsRenderer.php
+++ b/NewsRenderer.php
@@ -50,8 +50,8 @@
public $permalinks; //wether to force permalinks in feeds, even in 
publication mode
 
static function newFromArticle( $article, $parser ) {
-   $article->getContent();
-   $text = $article->mContent;
+   $content = $article->getContentObject();
+   $text = ContentHandler::getContentText( $content );
if (!$text) return null;
 
$uniq_prefix = "\x07NR-UNIQ";
@@ -844,4 +844,3 @@
$this->view( false );
}
 }
-

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a0009d877281b2300ce31ac4afaecac005e91d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/News
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...LogEntry[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326462 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

"Article::getContent" is deprecated - replaced usage

Bug: T151973
Change-Id: I95141150dbb0391764e819792b4cc0d4526bef54
---
M LogEntry.page.php
1 file changed, 20 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LogEntry 
refs/changes/62/326462/1

diff --git a/LogEntry.page.php b/LogEntry.page.php
index 2464117..cab2eff 100644
--- a/LogEntry.page.php
+++ b/LogEntry.page.php
@@ -8,21 +8,21 @@
 
 // LogEntry special page
 class SpecialLogEntry extends UnlistedSpecialPage {
-   
+
/* Functions */
-   
+
public function __construct() {
// Register the special page as unlisted
parent::__construct( 'LogEntry' );
}
-   
+
public function execute( $par ) {
global $wgRequest, $wgOut, $wgUser;
global $egLogEntryUserName, $egLogEntryTimeStamp;
-   
+
// Begin output
$this->setHeaders();
-   
+
// Check that the form was submitted
if( $wgRequest->wasPosted() ) {
// Check token
@@ -32,19 +32,19 @@
$wgOut->addWikiMsg( 'logentry-invalidtoken' );
return;
}
-   
+
// Get page
$page = $wgRequest->getText('page');
 
// Get title
$title = Title::newFromText( $page );
-   
+
// Check permissions
if( $title && $title->userCan( 'edit' ) )
{
// Get article
$article = new Article( $title, 0 );
-   
+
// Build new line
$newLine = '*';
if ( $egLogEntryUserName ) {
@@ -56,16 +56,17 @@
$newLine .= $this->msg( 'colon-separator' 
)->inContentLanguage()->text() .
str_replace( "\n", '',
trim( htmlspecialchars( 
$wgRequest->getText( 'line' ) ) ) );
-   
+
// Get content without logentry tag in it
-   $content = $article->getContent();
-   
+   $contentObj = $article->getContentObject();
+   $content = ContentHandler::getContentText( 
$contentObj );
+
// Detect section date
$contentLines = explode( "\n", $content );
-   
+
// Build heading
$heading = sprintf( '== %s ==', gmdate( 'F j' ) 
);
-   
+
// Find line of first section
$sectionLine = false;
foreach( $contentLines as $i => $contentLine )
@@ -76,19 +77,19 @@
break;
}
}
-   
+
// Assemble final output
$output = '';
if( $sectionLine !== false )
{
// Lines up to section
$preLines = array_slice( $contentLines, 
0, $sectionLine );
-   
+
// Lines after section
$postLines = array_slice( 
$contentLines, $sectionLine + 1 );
-   
+
// Output Lines
-   $outputLines = array(); 
+   $outputLines = array();
 
if( trim( $contentLines[$sectionLine] ) 
== $heading ) {
// Top section is current
@@ -121,10 +122,10 @@
// There is no section, make one
$output = sprintf( "%s\n%s\n%s", 
$content, $heading, $newLine );
}
-   
+
// Edit article
  

[MediaWiki-commits] [Gerrit] mediawiki...PageSchemas[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326460 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage"

Bug: T151973
Change-Id: I9eb038e9efbd5b8d63ed70c6e565fe61dce15d84
---
M specials/PS_EditSchema.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageSchemas 
refs/changes/60/326460/1

diff --git a/specials/PS_EditSchema.php b/specials/PS_EditSchema.php
index 43641df..6728fa3 100644
--- a/specials/PS_EditSchema.php
+++ b/specials/PS_EditSchema.php
@@ -660,9 +660,9 @@
if ( $save_page ) {
$psXML = self::createPageSchemaXMLFromForm();
$categoryTitle = Title::newFromText( $category, 
NS_CATEGORY );
-   $categoryArticle = new Article( $categoryTitle );
+   $categoryPage = new WikiPage( $categoryTitle );
if ( $categoryTitle->exists() ) {
-   $pageText = $categoryArticle->getContent();
+   $pageText = 
$categoryPage->getContent()->getNativeData();
$pageSchemaObj = new PSSchema( $category );
if ( $pageSchemaObj->isPSDefined() ) {
// Do some preg_replace magic.
@@ -678,7 +678,8 @@
$pageText = $psXML;
}
$editSummary = $wgRequest->getVal( 'wpSummary' );
-   $categoryArticle->doEdit( $pageText, $editSummary );
+   $pageContent = ContentHandler::makeContent( $pageText, 
$categoryPage->getTitle() );
+   $categoryPage->doEditContent( $pageContent, 
$editSummary );
$redirectURL = $categoryTitle->getLocalURL();
$text = <<

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9eb038e9efbd5b8d63ed70c6e565fe61dce15d84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageSchemas
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...PdfExport[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326451 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage"

Bug: T151973
Change-Id: I0dc43c8ed8e8cad56f0c5bb96feaefc601a26a11
---
M converters/DomPdfConverter.php
1 file changed, 16 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PdfExport 
refs/changes/51/326451/1

diff --git a/converters/DomPdfConverter.php b/converters/DomPdfConverter.php
index c3b9119..69b8224 100755
--- a/converters/DomPdfConverter.php
+++ b/converters/DomPdfConverter.php
@@ -4,19 +4,19 @@
 
 /**
  * A DomPdf based conversion backend.
- * 
+ *
  * Installation:
  * DomPdf can be downloaded from here: http://code.google.com/p/dompdf/. Unzip 
the code into your
  * extension directory and set $wgPdfExportDomPdfConfigFile equal to the full 
path to the
  * dompdf_config.inc.php file.
- * 
+ *
  * @author Andreas Hagmann
  * @author Dumpydooby
  * @author Christian Neubauer
  */
 class DomPdfConverter extends PdfConverter {
/**
-* Sets up any necessary command line options. 
+* Sets up any necessary command line options.
 * @param Array $options An array of options.
 */
function initialize (&$options) {
@@ -78,12 +78,12 @@
$html = str_replace ('', 
"", $html);
 
// Work around slow PDF generation on large pages.
-   if( !ini_get('safe_mode') ) { 
-set_time_limit(120); 
-} 
-
+   if( !ini_get('safe_mode') ) {
+set_time_limit(120);
+}
+
 // TODO disable warnings temporarily and then pipe them to the log.
-
+
global $wgOut, $IP, $wgPdfExportAttach;
$wgOut->disable();
#$old_error_level = error_reporting( 0 );
@@ -115,7 +115,7 @@
$dompdf->stream(utf8_decode($options['filename']) . ".pdf", 
array('Attachment'=>($wgPdfExportAttach?1:0)));
#error_reporting( $old_error_level );
}
-   
+
/**
 * Get the HTML for a page. This function should filter out any code 
that the converter can't handle like 

[MediaWiki-commits] [Gerrit] mediawiki...PrivateDomains[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326447 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage"

Bug: T151973
Change-Id: If5ab7c0dd23269f6de51557029e8cc172621a767
---
M SpecialPrivateDomains.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PrivateDomains 
refs/changes/47/326447/1

diff --git a/SpecialPrivateDomains.php b/SpecialPrivateDomains.php
index 0186224..73b7035 100644
--- a/SpecialPrivateDomains.php
+++ b/SpecialPrivateDomains.php
@@ -53,8 +53,8 @@
static function getParam( $name ) {
$nameTitle = Title::newFromText( $name, NS_MEDIAWIKI );
if ( $nameTitle->exists() ) {
-   $article = new Article( $nameTitle );
-   return $article->getContent();
+   $page = new WikiPage( $nameTitle );
+   return $page->getContent()->getNativeData();
} else {
return '';
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5ab7c0dd23269f6de51557029e8cc172621a767
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PrivateDomains
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...PollNY[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-12 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326442 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage"

Bug: T151973
Change-Id: Ib68a20e9fd16e221f1e8e5edb7aad26d504089c0
---
M PollNYHooks.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PollNY 
refs/changes/42/326442/1

diff --git a/PollNYHooks.php b/PollNYHooks.php
index fe8d704..60e5680 100644
--- a/PollNYHooks.php
+++ b/PollNYHooks.php
@@ -167,11 +167,11 @@
}
 
public static function followPollID( $pollTitle ) {
-   $pollArticle = new Article( $pollTitle );
-   $pollWikiContent = $pollArticle->getContent();
+   $pollPage = new WikiPage( $pollTitle );
+   $pollWikiContent = $pollPage->getContent();
 
-   if( $pollArticle->isRedirect( $pollWikiContent ) ) {
-   $pollTitle = $pollArticle->followRedirect();
+   if( $pollPage->isRedirect( $pollWikiContent ) ) {
+   $pollTitle = $pollPage->followRedirect();
return PollNYHooks::followPollID( $pollTitle );
} else {
return $pollTitle;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib68a20e9fd16e221f1e8e5edb7aad26d504089c0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PollNY
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...BreadCrumbs2[master]: Cleaned "Article::getContent" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326351 )

Change subject: Cleaned "Article::getContent" deprecated in MediaWiki 1.21
..

Cleaned "Article::getContent" deprecated in MediaWiki 1.21

"Article::getContent" is deprecated - cleaned code

Bug: T151973
Change-Id: Ica59317c4c16adb0784ab8285aaec99bd6824551
---
M BreadCrumbs2.class.php
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BreadCrumbs2 
refs/changes/51/326351/1

diff --git a/BreadCrumbs2.class.php b/BreadCrumbs2.class.php
index e6cf462..1cc7d1e 100644
--- a/BreadCrumbs2.class.php
+++ b/BreadCrumbs2.class.php
@@ -232,10 +232,6 @@
} else {
return null;
}
-   } else {
-   // MW <= 1.20
-   $article = new Article( $title );
-   return $article->getContent();
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica59317c4c16adb0784ab8285aaec99bd6824551
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BreadCrumbs2
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...BookManager[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326349 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "getContent" with 
"getContent()->getNativeData()"

Bug: T151973
Change-Id: I43e9e6b7ebd262bc44548e721b62840ff0e21421
---
M BookManager.body.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BookManager 
refs/changes/49/326349/1

diff --git a/BookManager.body.php b/BookManager.body.php
index 877ecd2..b04290f 100644
--- a/BookManager.body.php
+++ b/BookManager.body.php
@@ -80,9 +80,9 @@
}
$caps = array();
 
-   $collectionpage = new Article( $collectiontitle );
+   $collectionpage = WikiPage::factory( $collectiontitle );
 
-   foreach ( preg_split( '/[\r\n]+/', 
$collectionpage->getContent() ) as $line ) {
+   foreach ( preg_split( '/[\r\n]+/', 
$collectionpage->getContent()->getNativeData() ) as $line ) {
$item = self::parseCollectionLine( $line );
if ( !is_null( $item ) ) {
$caps[] = $item;
@@ -426,7 +426,7 @@
$chapterPage = new Article( $chapterTitle );
$sectionname = $chapterTitle->getSubpageText();
$text .= "= $sectionname =\n";
-   $text .= $chapterPage->getContent() . "\n\n";
+   $text .= ContentHandler::getContentText( 
$chapterPage->getContentObject() ) . "\n\n";
}
$out->addWikiText( $text );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43e9e6b7ebd262bc44548e721b62840ff0e21421
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BookManager
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326346 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "getContent" with 
"getContent()->getNativeData()"

Change-Id: I7f73b50a13dfef83dd83d4672606d7be5c890341
---
M RSSStandards/RSSStandards.class.php
1 file changed, 50 insertions(+), 14 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/46/326346/1

diff --git a/RSSStandards/RSSStandards.class.php 
b/RSSStandards/RSSStandards.class.php
index 3f2f9c9..e6c9349 100644
--- a/RSSStandards/RSSStandards.class.php
+++ b/RSSStandards/RSSStandards.class.php
@@ -57,7 +57,7 @@
/**
 * Hook-Handler for MediaWiki hook MediaWikiPerformAction
 * @param OutputPage $wgOut MediaWiki Outpupage object.
-* @param Article $article MediaWiki article object.
+* @param WikiPage $page MediaWiki page object.
 * @param Title $title MediaWiki title object.
 * @param User $user MediaWiki user object.
 * @param Request $request MediaWiki request object.
@@ -150,7 +150,11 @@
)
);
 
-   $oChannel = RSSCreator::createChannel(RSSCreator::xmlEncode( 
$wgSitename . ' - ' . $sPageName), 
'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], wfMessage( 
'bs-rssstandards-desc-page' )->plain() );
+   $oChannel = RSSCreator::createChannel(
+   RSSCreator::xmlEncode( $wgSitename . ' - ' . 
$sPageName),
+   'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],
+   wfMessage( 'bs-rssstandards-desc-page' )->plain()
+   );
while( $row = $res->fetchObject() ) {
$title = Title::makeTitle( $row->rc_namespace, 
$row->rc_title );
$entry = RSSItemCreator::createItem(
@@ -192,7 +196,11 @@
$res = false;
}
 
-   $channel = RSSCreator::createChannel(RSSCreator::xmlEncode( 
$wgSitename . ' - ' . wfMessage( 'bs-rssstandards-title-own' )->plain() ), 
'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], wfMessage( 
'bs-rssstandards-desc-own' )->plain() );
+   $channel = RSSCreator::createChannel(
+   RSSCreator::xmlEncode( $wgSitename . ' - ' . wfMessage( 
'bs-rssstandards-title-own' )->plain() ),
+   'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],
+   wfMessage( 'bs-rssstandards-desc-own' )->plain()
+   );
if ( $res ) {
while ( $obj = $res->fetchObject() ) {
$title = Title::makeTitle( $obj->rc_namespace, 
$obj->rc_title );
@@ -219,7 +227,11 @@
 
$cat = $wgRequest->getVal( 'cat', '' );
 
-   $channel = RSSCreator::createChannel($wgSitename . ' - ' . 
wfMessage( 'bs-rssstandards-title-cat' )->plain() . ' ' . addslashes( $cat ), 
'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], wfMessage( 
'bs-rssstandards-desc-cat' )->plain() );
+   $channel = RSSCreator::createChannel(
+   $wgSitename . ' - ' . wfMessage( 
'bs-rssstandards-title-cat' )->plain() . ' ' . addslashes( $cat ),
+   'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],
+   wfMessage( 'bs-rssstandards-desc-cat' )->plain()
+   );
 
$res = $dbr->query( "select cl_from FROM 
".$wgDBprefix."categorylinks WHERE cl_to = '".addslashes( $cat )."'" );
 
@@ -229,7 +241,10 @@
}
 
if ( count( $entryIds ) ) {
-   $query = "SELECT Min(r.rev_id) as rid, r.rev_page, 
r.rev_timestamp, r.rev_user_text FROM ".$wgDBprefix."revision as r WHERE 
r.rev_page In (".implode(",",$entryIds).") GROUP BY r.rev_page, 
r.rev_timestamp, r.rev_user_text ORDER BY rid DESC";
+   $query = "SELECT Min(r.rev_id) as rid, r.rev_page, 
r.rev_timestamp, r.rev_user_text FROM ".
+   $wgDBprefix."revision as r WHERE r.rev_page In ("
+   .implode(",",$entryIds).
+   ") GROUP BY r.rev_page, r.rev_timestamp, 
r.rev_user_text ORDER BY rid DESC";
$res = $dbr->query( $query );
$numberOfEntries = $dbr->numRows( $res );
 
@@ -240,7 +255,7 @@
 
while ( $row = $dbr->fetchRow( $res ) ) {
$title = Title::newFromID( $row['rev_page'] );
-   $article = new Article( $title );
+   $page = WikiPage::factory( $title );
if ( !$title->userCan( 'read' 

[MediaWiki-commits] [Gerrit] mediawiki...BlogPage[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326344 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "getContent" with 
"getContent()->getNativeData()"

Bug: T151973
Change-Id: I2f027b14aa1fdb45e81c2979a4cf5564d846
---
M BlogPageClass.php
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlogPage 
refs/changes/44/326344/1

diff --git a/BlogPageClass.php b/BlogPageClass.php
index 18f2a31..c2434f6 100644
--- a/BlogPageClass.php
+++ b/BlogPageClass.php
@@ -4,7 +4,7 @@
  *
  * @file
  */
-class BlogPage extends Article {
+class BlogPage extends WikiPage {
 
public $title = null;
public $authors = array();
@@ -17,13 +17,13 @@
 
public function setContent() {
// Get the page content for later use
-   $this->pageContent = $this->getContent();
+   $this->pageContent = $this->getContent()->getNativeData();
 
// If it's a redirect, in order to get the *real* content for 
later use,
// we have to load the text for the real page
// Note: If $this->getContent() is called anywhere before 
parent::view,
// the real article text won't get loaded on the page
-   if ( $this->isRedirect( $this->pageContent ) ) {
+   if ( $this->isRedirect( $this->getContent() ) ) {
wfDebugLog( 'BlogPage', __METHOD__ );
 
$target = $this->followRedirect();
@@ -40,8 +40,8 @@
// @see 
https://github.com/Brickimedia/brickimedia/issues/370
$this->getContext()->getOutput()->redirect( 
$target );
} else {
-   $rarticle = new Article( $target );
-   $this->pageContent = $rarticle->getContent();
+   $rpage = WikiPage::factory( $target );
+   $this->pageContent = 
$rpage->getContent()->getNativeData();
 
// If we don't clear, the page content will be 
[[redirect-blah]],
// and not the actual page
@@ -149,7 +149,7 @@
public function getAuthors() {
global $wgContLang;
 
-   $articleText = $this->pageContent;
+   $pageText = $this->pageContent;
$categoryName = $wgContLang->getNsText( NS_CATEGORY );
 
// This unbelievably weak and hacky regex is used to find out 
the
@@ -163,7 +163,7 @@
// days than this regex soup...
str_replace( ' $1', '', wfMessage( 
'blog-by-user-category' )->inContentLanguage()->escaped() ) .
" (.*)\]\]/",
-   $articleText,
+   $pageText,
$matches
);
$authors = $matches[1];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f027b14aa1fdb45e81c2979a4cf5564d846
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlogPage
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...ApprovedRevs[master]: Replaced "Article::getContent" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326342 )

Change subject: Replaced "Article::getContent" deprecated in MediaWiki 1.21
..

Replaced "Article::getContent" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "getContent" with 
"getContent()->getNativeData()"

Bug: T151973
Change-Id: Ib2785a04e23fb84011bc02ceea6160e47e91788f
---
M ApprovedRevs.hooks.php
M ApprovedRevs_body.php
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApprovedRevs 
refs/changes/42/326342/1

diff --git a/ApprovedRevs.hooks.php b/ApprovedRevs.hooks.php
index e417d2d..a80824e 100644
--- a/ApprovedRevs.hooks.php
+++ b/ApprovedRevs.hooks.php
@@ -141,8 +141,8 @@
// We only need to modify the search text if the approved
// revision is not the latest one.
if ( $revisionID != $article->getLatest() ) {
-   $approvedArticle = new Article( $title, $revisionID );
-   $approvedText = $approvedArticle->getContent();
+   $approvedPage = WikiPage::factory( $title, $revisionID 
);
+   $approvedText = 
$approvedPage->getContent()->getNativeData();
ApprovedRevs::setPageSearchText( $title, $approvedText 
);
}
 
diff --git a/ApprovedRevs_body.php b/ApprovedRevs_body.php
index 60ed528..6b1b45f 100644
--- a/ApprovedRevs_body.php
+++ b/ApprovedRevs_body.php
@@ -14,7 +14,7 @@
static $mApprovedContentForPage = array();
static $mApprovedRevIDForPage = array();
static $mUserCanApprove = null;
-   
+
/**
 * Gets the approved revision ID for this page, or null if there isn't
 * one.
@@ -54,8 +54,8 @@
$revision = Revision::newFromTitle( $title, $revisionID 
);
return $revision->getContent()->getNativeData();
} else {
-   $article = new Article( $title, $revisionID );
-   return $article->getContent();
+   $page = WikiPage::factory( $title, $revisionID );
+   return $page->getContent()->getNativeData();
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2785a04e23fb84011bc02ceea6160e47e91788f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ApprovedRevs
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...Patroller[master]: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326330 )

Change subject: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21
..

Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "doEdit" with 
"doEditContent"

Bug: T151973
Change-Id: Ic47f9adabf538a5fce04452bd04169ea287eab16
---
M SpecialPatroller.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Patroller 
refs/changes/30/326330/1

diff --git a/SpecialPatroller.php b/SpecialPatroller.php
index 257ce26..8461eca 100644
--- a/SpecialPatroller.php
+++ b/SpecialPatroller.php
@@ -328,8 +328,8 @@
if ( $edit->mAttribs['rc_this_oldid'] == $latest ) {
// Revert the edit; keep the reversion itself 
out of recent changes
wfDebugLog( 'patroller', 'Reverting "' . 
$title->getPrefixedText() . '" to r' . $old->getId() );
-   $article = new Article( $title );
-   $article->doEdit( $old->getText(), $comment, 
EDIT_UPDATE & EDIT_MINOR & EDIT_SUPPRESS_RC );
+   $page = WikiPage::factory( $title );
+   $page->doEditContent( $old->getContentText(), 
$comment, EDIT_UPDATE & EDIT_MINOR & EDIT_SUPPRESS_RC );
}
// Mark the edit patrolled so it doesn't bother us again
RecentChange::markPatrolled( $edit->mAttribs['rc_id'] );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic47f9adabf538a5fce04452bd04169ea287eab16
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Patroller
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...PollNY[master]: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326328 )

Change subject: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21
..

Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "doEdit" with 
"doEditContent"

Bug: T151973
Change-Id: I3793fd8faf3a0ac79f0a1b353245b2f74fd70897
---
M SpecialCreatePoll.php
1 file changed, 10 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PollNY 
refs/changes/28/326328/1

diff --git a/SpecialCreatePoll.php b/SpecialCreatePoll.php
index c2dc5c0..457b1e0 100644
--- a/SpecialCreatePoll.php
+++ b/SpecialCreatePoll.php
@@ -106,18 +106,23 @@
 
// Create poll wiki page
$localizedCategoryNS = $wgContLang->getNsText( 
NS_CATEGORY );
-   $article = new Article( $poll_title );
-   $article->doEdit(
+   $page = WikiPage::factory( $poll_title );
+   $content = ContentHandler::makeContent(
"\n$choices\n\n[[" .
$localizedCategoryNS . ':' .
$this->msg( 'poll-category' 
)->inContentLanguage()->plain() . "]]\n" .
'[[' . $localizedCategoryNS . ':' .
-   $this->msg( 'poll-category-user', 
$user->getName() )->inContentLanguage()->text()  . "]]\n" .
+   $this->msg( 'poll-category-user',
+   $poll_title
+   }
+   $page->doEditContent(
+   $content,
+   $user->getName() )->inContentLanguage()->text() 
 . "]]\n" .
'[[' . $localizedCategoryNS . 
":{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}, 
{{subst:CURRENTYEAR}}]]\n\n__NOEDITSECTION__",
$this->msg( 'poll-edit-desc' 
)->inContentLanguage()->plain()
);
 
-   $newPageId = $article->getID();
+   $newPageId = $page->getID();
 
$p = new Poll();
$poll_id = $p->addPollQuestion(
@@ -158,4 +163,4 @@
protected function getGroupName() {
return 'poll';
}
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3793fd8faf3a0ac79f0a1b353245b2f74fd70897
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PollNY
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...PrivateDomains[master]: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326327 )

Change subject: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21
..

Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "doEdit" with 
"doEditContent"

Bug: T151973
Change-Id: Ic6835a115eb03098db978e9b5f6d64602f93d46c
---
M SpecialPrivateDomains.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PrivateDomains 
refs/changes/27/326327/1

diff --git a/SpecialPrivateDomains.php b/SpecialPrivateDomains.php
index cfc433c..0186224 100644
--- a/SpecialPrivateDomains.php
+++ b/SpecialPrivateDomains.php
@@ -36,9 +36,12 @@
 */
function saveParam( $name, $value ) {
$nameTitle = Title::newFromText( $name, NS_MEDIAWIKI );
-   $article = new Article( $nameTitle );
+   $page = WikiPage::factory( $nameTitle );
 
-   $article->doEdit( $value, '' );
+   $page->doEditContent(
+   ContentHandler::makeContent( $value, $nameTitle ),
+   ''
+   );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6835a115eb03098db978e9b5f6d64602f93d46c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PrivateDomains
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...RDFIO[master]: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326326 )

Change subject: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21
..

Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "doEdit" with 
"doEditContent"

Bug: T151973
Change-Id: I05428c3ec6e7308dca836a535a7fb927b7718601
---
M classes/RDFIO_SMWPageWriter.php
1 file changed, 25 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RDFIO 
refs/changes/26/326326/1

diff --git a/classes/RDFIO_SMWPageWriter.php b/classes/RDFIO_SMWPageWriter.php
index 3254c08..cfffcd2 100644
--- a/classes/RDFIO_SMWPageWriter.php
+++ b/classes/RDFIO_SMWPageWriter.php
@@ -9,26 +9,26 @@
public function import( $wikiPages ) {
 
foreach ( $wikiPages as $wikiTitle => $wikiPage ) {
-   
+
// Sanitize the title a bit
$wikiTitle = str_replace('[','',$wikiTitle);
$wikiTitle = str_replace(']','',$wikiTitle);
-   
+
$facts = $wikiPage['facts'];
$equivuris = $wikiPage['equivuris'];
-   
+
# Populate the facts array also with the equivalent URI 
"facts"
foreach ( $equivuris as $equivuri ) {
$facts[] = array( 'p' => "Equivalent URI", 'o' 
=> $equivuri );
}
-   
+
$mwTitleObj = Title::newFromText( $wikiTitle );
-   
+
if ( !$mwTitleObj->exists() ) {
-   // Create stub article 
-   $this->writeToArticle( $wikiTitle, '', 'Article 
Created by RDFIO' );
-   } 
-   
+   // Create stub page
+   $this->writeToPage( $wikiTitle, '', 'Page 
Created by RDFIO' );
+   }
+
$womWikiPage = WOMProcessor::getPageObject( $mwTitleObj 
);
$womPropertyObjs = array();
 
@@ -42,9 +42,9 @@
}
} catch( Exception $e ) {
// @TODO Take better care of this?
-   // echo( 'Exception when talking to WOM: ' 
. $e->getMessage() . '' ); 
+   // echo( 'Exception when talking to WOM: ' 
. $e->getMessage() . '' );
}
-   
+
$newPropertiesAsWikiText = "\n";
 
foreach ( $facts as $fact ) {
@@ -55,34 +55,37 @@
$newWomPropertyObj = new 
WOMPropertyModel( $pred, $obj, '' );
$newPropertyAsWikiText = 
$newWomPropertyObj->getWikiText();
$newPropertiesAsWikiText .= 
$newPropertyAsWikiText . "\n";
-   
+
$wikiContent = 
$womWikiPage->getWikiText() . $newPropertiesAsWikiText;
} else {
$womPropertyObj = 
$womPropertyObjs[$pred];
-   
+
// Store the old wiki text for the 
fact, in order to replace later
$oldPropertyText = 
$womPropertyObj->getWikiText();
-   
+
// Create an updated property
$objTitle = Title::newFromText( $obj );
$newSMWPageValue = 
SMWWikiPageValue::makePageFromTitle( $objTitle );
$womPropertyObj->setSMWDataValue( 
$newSMWPageValue );
$newPropertyText = 
$womPropertyObj->getWikiText();
-   
+
// Replace the existing property with 
new value
$wikiContent = 
$womWikiPage->getWikiText();
$wikiContent = str_replace( 
$oldPropertyText, $newPropertyText, $wikiContent );
}
-   }   
-   // Write changes (or additions) to article
-   $this->writeToArticle($wikiTitle, $wikiContent, 'Update 
by RDFIO');
+   }
+   // Write changes (or additions) to WikiPage
+   $this->writeToPage($wikiTitle, $wikiContent, 'Update by 
RDFIO');
}
}

[MediaWiki-commits] [Gerrit] mediawiki...Video[master]: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326323 )

Change subject: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21
..

Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "doEdit" with 
"doEditContent"

Bug: T151973
Change-Id: I3aa72fb156a64c35d6156c7beef07a1e9dd118e3
---
M VideoClass.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Video 
refs/changes/23/326323/1

diff --git a/VideoClass.php b/VideoClass.php
index b1be28e..7ec9739 100644
--- a/VideoClass.php
+++ b/VideoClass.php
@@ -228,7 +228,7 @@
}
 
$descTitle = $this->getTitle();
-   $article = new Article( $descTitle );
+   $page = WikiPage::factory( $descTitle );
$watch = $watch || $user->isWatched( $descTitle );
 
// Get the localized category name
@@ -262,7 +262,11 @@
} else {
// New video; create the description page.
// Supress the recent changes bc it will appear in the 
log/video
-   $article->doEdit( $categoryWikiText, '', 
EDIT_SUPPRESS_RC );
+   $page->doEditContent(
+   ContentHandler::makeContent($categoryWikiText, 
$page->getTitle(),
+   '',
+   EDIT_SUPPRESS_RC
+   );
}
 
if ( $watch ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3aa72fb156a64c35d6156c7beef07a1e9dd118e3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Video
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikiObjectModel[master]: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326322 )

Change subject: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21
..

Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "doEdit" with 
"doEditContent"

Bug: T151973
Change-Id: I60be2346d9da5a56b9f7723af219bafc35606595
---
M includes/WOM_Processor.php
1 file changed, 21 insertions(+), 21 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiObjectModel 
refs/changes/22/326322/1

diff --git a/includes/WOM_Processor.php b/includes/WOM_Processor.php
index 62a0e24..43c3e60 100644
--- a/includes/WOM_Processor.php
+++ b/includes/WOM_Processor.php
@@ -601,9 +601,9 @@
$wom->insertPageObject( $object, $obj_id );
 
// save to wiki
-   $article = new Article( $title );
-   $content = $wom->getWikiText();
-   $article->doEdit( $content, $summary );
+   $page = WikiPage::factory( $title );
+   $content = ContentHandler::makeContent( $wom->getWikiText(), 
$title );
+   $page->doEditContent( $content, $summary );
 
wfProfileOut( $fname );
}
@@ -631,9 +631,9 @@
$wom->appendChildObject( $object, $obj_id );
 
// save to wiki
-   $article = new Article( $title );
-   $content = $wom->getWikiText();
-   $article->doEdit( $content, $summary );
+   $page = WikiPage::factory( $title );
+   $content = ContentHandler::makeContent( $wom->getWikiText(), 
$title );
+   $page->doEditContent( $content, $summary );
 
wfProfileOut( $fname );
}
@@ -655,9 +655,9 @@
$wom->updatePageObject( $object, $obj_id );
 
// save to wiki
-   $article = new Article( $title );
-   $content = $wom->getWikiText();
-   $article->doEdit( $content, $summary );
+   $page = WikiPage::factory( $title );
+   $content = ContentHandler::makeContent( $wom->getWikiText(), 
$title );
+   $page->doEditContent( $content, $summary );
 
wfProfileOut( $fname );
}
@@ -679,9 +679,9 @@
$wom->removePageObject( $obj_id );
 
// save to wiki
-   $article = new Article( $title );
-   $content = $wom->getWikiText();
-   $article->doEdit( $content, $summary );
+   $page = WikiPage::factory( $title );
+   $content = ContentHandler::makeContent( $wom->getWikiText(), 
$title );
+   $page->doEditContent( $content, $summary );
 
wfProfileOut( $fname );
}
@@ -705,9 +705,9 @@
$wom->insertPageObject( new WOMTextModel( $text ), $obj_id );
 
// save to wiki
-   $article = new Article( $title );
-   $content = $wom->getWikiText();
-   $article->doEdit( $content, $summary );
+   $page = WikiPage::factory( $title );
+   $content = ContentHandler::makeContent( $wom->getWikiText(), 
$title );
+   $page->doEditContent( $content, $summary );
 
wfProfileOut( $fname );
}
@@ -737,9 +737,9 @@
$wom->appendChildObject( new WOMTextModel( $text ), $obj_id );
 
// save to wiki
-   $article = new Article( $title );
-   $content = $wom->getWikiText();
-   $article->doEdit( $content, $summary );
+   $page = WikiPage::factory( $title );
+   $content = ContentHandler::makeContent( $wom->getWikiText(), 
$title );
+   $page->doEditContent( $content, $summary );
 
wfProfileOut( $fname );
}
@@ -763,9 +763,9 @@
$wom->updatePageObject( new WOMTextModel( $text ), $obj_id );
 
// save to wiki
-   $article = new Article( $title );
-   $content = $wom->getWikiText();
-   $article->doEdit( $content, $summary );
+   $page = WikiPage::factory( $title );
+   $content = ContentHandler::makeContent( $wom->getWikiText(), 
$title );
+   $page->doEditContent( $content, $summary );
 
wfProfileOut( $fname );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60be2346d9da5a56b9f7723af219bafc35606595
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiObjectModel
Gerrit-Branch: master
Gerrit-Owner: Filip 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] mediawiki...Wikilog[master]: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

2016-12-11 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326321 )

Change subject: Replaced "Article::doEdit()" deprecated in MediaWiki 1.21
..

Replaced "Article::doEdit()" deprecated in MediaWiki 1.21

Replaced "Article" class with "WikiPage", and replaced "doEdit" with 
"doEditContent"

Bug: T151973
Change-Id: I12b59d5abd6e21f9613f2e901e8b87c2dc1019f8
---
M WikilogComment.php
M WikilogCommentsPage.php
2 files changed, 10 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikilog 
refs/changes/21/326321/1

diff --git a/WikilogComment.php b/WikilogComment.php
index 6bbc783..41db768 100644
--- a/WikilogComment.php
+++ b/WikilogComment.php
@@ -195,11 +195,12 @@
# Save article with comment text.
if ( $this->mTextChanged ) {
$this->mCommentTitle = $this->getCommentArticleTitle();
-   $art = new Article( $this->mCommentTitle );
-   $art->doEdit( $this->mText, $this->getAutoSummary() );
+   $page = WikiPage::factory( $this->mCommentTitle );
+   $pageContent = ContentHandler::makeContent( 
$this->mText, $page->getTitle() );
+   $page->doEditContent( $pageContent, 
$this->getAutoSummary() );
$this->mTextChanged = false;
 
-   $this->mCommentPage = $art->getID();
+   $this->mCommentPage = $page->getID();
$delayed['wlc_comment_page'] = $this->mCommentPage;
}
 
diff --git a/WikilogCommentsPage.php b/WikilogCommentsPage.php
index 351f5ec..1b2b68d 100644
--- a/WikilogCommentsPage.php
+++ b/WikilogCommentsPage.php
@@ -45,7 +45,7 @@
  * talk pages, you may want to check LiquidThreads or some other extension.
  */
 class WikilogCommentsPage
-   extends Article
+   extends WikiPage
implements WikilogCustomAction
 {
protected $mFormatter;  ///< Comment formatter.
@@ -450,8 +450,12 @@
if ( !$this->exists() ) {
# Initialize a blank talk page.
$user = User::newFromName( wfMessage( 'wikilog-auto' 
)->inContentLanguage()->text(), false );
-   $this->doEdit(
+   $pageContent = ContentHandler::makeContent(
wfMessage( 'wikilog-newtalk-text' 
)->inContentLanguage()->text(),
+   $this->getTitle()
+   );
+   $this->doEditContent(
+   $pageContent,
wfMessage( 'wikilog-newtalk-summary' 
)->inContentLanguage()->text(),
EDIT_NEW | EDIT_SUPPRESS_RC, false, $user
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12b59d5abd6e21f9613f2e901e8b87c2dc1019f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikilog
Gerrit-Branch: master
Gerrit-Owner: Filip 

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


[MediaWiki-commits] [Gerrit] mediawiki...SmiteSpam[master]: Replace "wfMessage(" with "$this->msg" in SmiteSpam's Specia...

2016-12-10 Thread Filip (Code Review)
Filip has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326282 )

Change subject: Replace "wfMessage(" with "$this->msg" in SmiteSpam's 
SpecialPages
..

Replace "wfMessage(" with "$this->msg" in SmiteSpam's SpecialPages

Replaced global wfMessage with $this->msg in Special pages

Bug: T152852
Change-Id: Ida56ff4223559d88f16421cd83736d23728b2a8f
---
M SpecialSmiteSpam.php
M SpecialSmiteSpamTrustedUsers.php
2 files changed, 11 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SmiteSpam 
refs/changes/82/326282/1

diff --git a/SpecialSmiteSpam.php b/SpecialSmiteSpam.php
index 4640d43..3b385ac 100644
--- a/SpecialSmiteSpam.php
+++ b/SpecialSmiteSpam.php
@@ -22,7 +22,7 @@
$out->addHTML(
$this->getLinkRenderer()->makeLink(
SpecialPage::getTitleFor( 
'SmiteSpamTrustedUsers' ),
-   wfMessage( 'smitespam-view-trusted-users' 
)->text(),
+   $this->msg( 'smitespam-view-trusted-users' 
)->text(),
[ 'target' => '_blank' ]
)
);
diff --git a/SpecialSmiteSpamTrustedUsers.php b/SpecialSmiteSpamTrustedUsers.php
index dcb50f4..38f753f 100644
--- a/SpecialSmiteSpamTrustedUsers.php
+++ b/SpecialSmiteSpamTrustedUsers.php
@@ -34,7 +34,7 @@
if ( $result ) {
$out->addHTML(
'' .
-   "" . wfMessage( 
'smitespam-already-trusted', $username )->text() . "" .
+   "" . $this->msg( 
'smitespam-already-trusted', $username )->text() . "" .
''
);
} else {
@@ -50,14 +50,14 @@
);
$out->addHTML(
'' .
-   "" . wfMessage( 
'smitespam-trusted-user-message', $username )->escaped() . "" .
+   "" . $this->msg( 
'smitespam-trusted-user-message', $username )->escaped() . "" .
''
);
}
} else {
$out->addHTML(
'' .
-   "" . wfMessage( 
'smitespam-userdoesnotexist', $username )->escaped() . "" .
+   "" . $this->msg( 
'smitespam-userdoesnotexist', $username )->escaped() . "" .
''
);
}
@@ -94,16 +94,16 @@
 
$out->addHTML( "" );
 
-   $out->addHTML( '' . wfMessage( 
'smitespam-add-user-label' )->text() .
+   $out->addHTML( '' . $this->msg( 
'smitespam-add-user-label' )->text() .
'' .
-   ' ' );
 
$out->addHTML( '' .
-   '' . wfMessage( 'smitespam-trusted-user' )->text() 
. '' .
-   '' . wfMessage( 'smitespam-timestamp' )->text() . 
'' .
-   '' . wfMessage( 'smitespam-trusting-admin' 
)->text() . '' .
-   '' . wfMessage( 'smitespam-remove' )->text() . 
'' .
+   '' . $this->msg( 'smitespam-trusted-user' )->text() 
. '' .
+   '' . $this->msg( 'smitespam-timestamp' )->text() . 
'' .
+   '' . $this->msg( 'smitespam-trusting-admin' 
)->text() . '' .
+   '' . $this->msg( 'smitespam-remove' )->text() . 
'' .
''
);
$linkRenderer = $this->getLinkRenderer();
@@ -131,7 +131,7 @@
"$timestamp" .
"$adminContribsLink" .
"" .
-   wfMessage( 'smitespam-remove' )->text() . 
""
+   $this->( 'smitespam-remove' )->parse() . 
""
);
}
$out->addHTML( '' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida56ff4223559d88f16421cd83736d23728b2a8f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SmiteSpam

  1   2   >