[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Support editing previous revisions

2017-08-12 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371648 )

Change subject: Support editing previous revisions
..

Support editing previous revisions

Before, when a user attempted to edit a previous revision, an error
was thrown. This change adds support for attempting this action.

Bug: T173224
Change-Id: I8f1c1cde19391457a0fa71f082c5269fc1ddf4d9
---
M i18n/en.json
M i18n/qqq.json
M includes/NewsletterEditPage.php
3 files changed, 14 insertions(+), 18 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index a0ccb9a..76ca162 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -14,8 +14,6 @@
"newsletter-title": "Wiki page to be linked as Main page",
"newsletter-exist-error": "A newsletter with the name \"$1\" already 
exists. Please try again with another name.",
"newsletter-create-error": "An error occured while trying to create a 
new newsletter. Please try again.",
-   "newsletter-oldrev-update-error-title": "Sorry, this operation is not 
permitted.",
-   "newsletter-oldrev-update-error-body": "Editing a previous revision is 
not supported by the Newsletter extension. Please update the latest revision 
instead",
"newsletter-input-required": "Required input was not entered. Please 
try again.",
"newsletter-invalid-name": "The name you entered for the newsletter is 
invalid. Please try again.",
"newslettercreate": "Create newsletter",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b604712..3dc2818 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -21,8 +21,6 @@
"newsletter-title": "Label of the field which takes the title of Main 
Page of newsletter as input in [[Special:CreateNewsletter]]",
"newsletter-exist-error": "Error message to be displayed in 
[[Special:CreateNewsletter]] when trying to create a newsletter with same name 
as an existing newsletter. $1- Name of newsletter",
"newsletter-create-error": "Error message shown on 
[[Special:CreateNewsletter]] if newsletter creation failed.",
-   "newsletter-oldrev-update-error-title": "Page title for error page 
shown on editing a previous revision",
-   "newsletter-oldrev-update-error-body": "Error description body for 
error page shown on editing a previous revision",
"newsletter-input-required": "Error message shown on 
[[Special:CreateNewsletter]] if required input is missing..",
"newsletter-invalid-name": "Error message shown on 
[[Special:CreateNewsletter]] if the newsletter name is invalid.",
"newslettercreate": "Name of [[Special:CreateNewsletter]]. This is used 
as the header on this page and shown in links to the page.",
diff --git a/includes/NewsletterEditPage.php b/includes/NewsletterEditPage.php
index 23d5b87..3adc6de 100644
--- a/includes/NewsletterEditPage.php
+++ b/includes/NewsletterEditPage.php
@@ -43,16 +43,10 @@
->params( $this->newsletter->getName() )
);
 
-   // We are not supporting editing a previous diff at 
this moment
-   if ( $this->context->getRequest()->getVal( 'oldid' ) ) {
-   throw new BadRequestError( 
'newsletter-oldrev-update-error-title',
-   'newsletter-oldrev-update-error-body'
-   );
-   }
-
$revId = $this->context->getRequest()->getVal( 
'undoafter', null );
$undoId = $this->context->getRequest()->getVal( 'undo', 
null );
-   $this->getManageForm( $revId, $undoId )->show();
+   $oldId = $this->context->getRequest()->getVal( 'oldid', 
null );
+   $this->getManageForm( $revId, $undoId, $oldId )->show();
} else {
$permErrors = $this->getPermissionErrors();
if ( count( $permErrors ) ) {
@@ -100,9 +94,10 @@
 *
 * @param int $revId
 * @param int $undoId
+* @param int $oldId
 * @return HTMLForm
 */
-   protected function getManageForm( $revId, $undoId ) {
+   protected function getManageForm( $revId, $undoId, $oldId ) {
$publishers = UserArray::newFromIDs( 
$this->newsletter->getPublishers() );
$publishersNames = [];
 
@@ -155,11 +150,16 @@
->params( 
$undoRevision->getId(), $undoRevision->getUserText() )
->inContentLanguage()
->text();
-   } else {
-   throw new BadRequestError(
-   'newsletter-oldrev-update-error-title',

[MediaWiki-commits] [Gerrit] mediawiki...WikiLove[master]: Add Goats to WikiLove

2017-08-12 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371627 )

Change subject: Add Goats to WikiLove
..

Add Goats to WikiLove

Bug: T173187
Change-Id: Iaa7bfbd7f7c9aa8bcdc2bfb77fb4ab9375afe057
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M resources/ext.wikiLove.defaultOptions.js
A resources/images/icons/wikilove-icon-goat.png
5 files changed, 20 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLove 
refs/changes/27/371627/1

diff --git a/extension.json b/extension.json
index 7f808d4..611ec8b 100644
--- a/extension.json
+++ b/extension.json
@@ -35,6 +35,7 @@
"wikilove-type-barnstars",
"wikilove-type-food",
"wikilove-type-kittens",
+   "wikilove-type-goats",
"wikilove-type-makeyourown",
"wikilove-barnstar-header",
"wikilove-barnstar-select",
@@ -157,7 +158,8 @@
"wikilove-food-stroopwafels-option",
"wikilove-food-stroopwafels-desc",
"wikilove-food-stroopwafels-header",
-   "wikilove-kittens-header"
+   "wikilove-kittens-header",
+   "wikilove-goats-header"
]
},
"ext.wikiLove.startup": {
diff --git a/i18n/en.json b/i18n/en.json
index acd2b91..d7297fd 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -152,6 +152,8 @@
"wikilove-food-stroopwafels-header": "Some stroopwafels for you!",
"wikilove-type-kittens": "Kittens",
"wikilove-kittens-header": "A kitten for you!",
+   "wikilove-type-goats": "Goats",
+   "wikilove-goats-header": "A goat for you!",
"wikilove-type-makeyourown": "Make your own",
"wikilove-err-header": "Please enter a header.",
"wikilove-err-title": "Please enter a title.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 12d7768..5669d31 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -163,6 +163,8 @@
"wikilove-food-stroopwafels-header": "A header of a 
[[:wikipedia:Barnstar]] of type \"food\" appears at the top of the talk page 
post.",
"wikilove-type-kittens": "[[File:Wiki Love 002.png|thumb]]\nLabel for a 
button. Should be no longer than 22 characters.",
"wikilove-kittens-header": "Used as header with JavaScript",
+   "wikilove-type-goats": "[[File:Wiki Love 002.png|thumb]]\nLabel for a 
button. Should be no longer than 22 characters.",
+   "wikilove-goats-header": "Used as header with JavaScript",
"wikilove-type-makeyourown": "[[File:Wiki Love 002.png|thumb]]\nLabel 
for a button. Should be no longer than 22 characters.",
"wikilove-err-header": "[[File:Wiki Love 004.png|thumb]]\nUse the same 
translation for \"header\" as was used for {{msg-mw|wikilove-header}}.",
"wikilove-err-title": "\nTitle is the title of the wikilove box (e.g. 
\"Barnstar\")",
diff --git a/resources/ext.wikiLove.defaultOptions.js 
b/resources/ext.wikiLove.defaultOptions.js
index 9b6cf1c..e7dfefc 100644
--- a/resources/ext.wikiLove.defaultOptions.js
+++ b/resources/ext.wikiLove.defaultOptions.js
@@ -363,6 +363,19 @@
},
icon: mw.config.get( 'wgExtensionAssetsPath' ) + 
'/WikiLove/resources/images/icons/wikilove-icon-kitten.png'
},
+   'goat': {
+   name: mw.msg( 'wikilove-type-goats' ),
+   fields: [ 'header', 'message' ],
+   header: mw.msg( 'wikilove-goats-header' ),
+   text: '[[$3|left|150px]]\n$1\n\n\n', // $3 is the image filename
+   gallery: {
+   imageList: [ 'A aesthetic goat.JPG', 'Boer Goat 
(8742860752).jpg', 'Házikecske portré.JPG'],
+   width: 145,
+   height: 150,
+   number: 3
+   },
+   icon: mw.config.get( 'wgExtensionAssetsPath' ) + 
'/WikiLove/resources/images/icons/wikilove-icon-goat.png'
+   },
// default type, nice to leave this one in place when adding 
other types
'makeyourown': {
name: mw.msg( 'wikilove-type-makeyourown' ),
diff --git a/resources/images/icons/wikilove-icon-goat.png 
b/resources/images/icons/wikilove-icon-goat.png
new file mode 100644
index 000..5accf71
--- /dev/null
+++ b/resources/images/icons/wikilove-icon-goat.png
Binary files differ

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

Gerrit-MessageType: 

[MediaWiki-commits] [Gerrit] mediawiki...RevisionSlider[master]: Fix unnecessary reloading of diff

2017-08-12 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371622 )

Change subject: Fix unnecessary reloading of diff
..

Fix unnecessary reloading of diff

Currently, when dragging a pointer over another revision but not
releasing it until it is at the same location, the diff still reloads
This change stores the initial positions and comparing at the end.

Bug: T163425
Change-Id: I430650d12bfeb3ce4af59abe91f18cc2b861a3de
---
M modules/ext.RevisionSlider.SliderView.js
1 file changed, 7 insertions(+), 0 deletions(-)


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

diff --git a/modules/ext.RevisionSlider.SliderView.js 
b/modules/ext.RevisionSlider.SliderView.js
index 75a5691..7b6f60d 100644
--- a/modules/ext.RevisionSlider.SliderView.js
+++ b/modules/ext.RevisionSlider.SliderView.js
@@ -419,6 +419,8 @@
self.setPointerDragCursor();
self.fadeOutPointerLines();
self.escapePressed = false;
+   self.startOldPointerPosition = 
self.getOlderPointerPos();
+   self.startNewPointerPosition = 
self.getNewerPointerPos();
},
stop: function () {
var $p = $( this ),
@@ -445,6 +447,11 @@
$revisions, 
self.getOlderPointerPos()
).data( 'revid' );
 
+   if ( self.getNewerPointerPos() === 
self.startNewPointerPosition ||
+   self.getOlderPointerPos() === 
self.startOldPointerPosition ) {
+   return;
+   }
+
self.refreshDiffView( diff, oldid, true 
);
self.alignPointersAndLines( 0 );

self.resetRevisionStylesBasedOnPointerPosition( $revisions );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I430650d12bfeb3ce4af59abe91f18cc2b861a3de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: [WIP] Add 'Mark all as read' button

2017-08-12 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371614 )

Change subject: [WIP] Add 'Mark all as read' button
..

[WIP] Add 'Mark all as read' button

Currently, the 'Mark all as read' button exists only for JS users.
This patch adds the button for no-JS users as well.

Bug: T96061
Change-Id: I1a62c56306597209540ffd694c8fb7b2a92885c9
---
M includes/special/SpecialNotifications.php
M includes/special/SpecialNotificationsMarkRead.php
2 files changed, 46 insertions(+), 2 deletions(-)


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

diff --git a/includes/special/SpecialNotifications.php 
b/includes/special/SpecialNotifications.php
index a03a83d..d96d1ba 100644
--- a/includes/special/SpecialNotifications.php
+++ b/includes/special/SpecialNotifications.php
@@ -114,6 +114,40 @@
$notifArray[ $dateHeader ][ 'notices' ][] = $li;
}
 
+   // Ensure there are some unread notifications
+   $markAllRead = false;
+   foreach ( $notifArray as $section => $data ) {
+   if ( count( $data[ 'unread' ] ) > 0 ) {
+   $markAllRead = true;
+   }
+   }
+
+   if ( $markAllRead ) {
+   $markReadSpecialPage = new 
SpecialNotificationsMarkRead();
+
+   $markReadSectionText = $this->msg( 
'echo-mark-all-as-read' )->text();
+   $markAsReadLabelIcon = new EchoOOUI\LabelIconWidget( [
+   'label' => $markReadSectionText,
+   'icon' => 'doubleCheck',
+   ] );
+
+   $markSectionAsReadForm = 
$markReadSpecialPage->getMinimalForm(
+   [ 'ALL' ],
+   $markReadSectionText,
+   true,
+   $markAsReadLabelIcon->toString()
+   );
+
+   $formHtml = 
$markSectionAsReadForm->prepareForm()->getHTML( /* First submission attempt */ 
false );
+
+   $markAllAsReadFormWrapper = new OOUI\Tag();
+   $markAllAsReadFormWrapper
+   ->appendContent( new OOUI\HtmlSnippet( 
$formHtml ) );
+
+   // $heading->appendContent( $formWrapper );
+   }
+   // End
+
// Build the list
$notices = new OOUI\Tag( 'ul' );
$notices->addClasses( [ 'mw-echo-special-notifications' ] );
@@ -184,6 +218,7 @@
->addClasses( [ 'mw-echo-special-container' ] )
->appendContent(
$navTop,
+   $markAllAsReadFormWrapper,
$notices,
$navBottom
);
diff --git a/includes/special/SpecialNotificationsMarkRead.php 
b/includes/special/SpecialNotificationsMarkRead.php
index 955fce6..9f17534 100644
--- a/includes/special/SpecialNotificationsMarkRead.php
+++ b/includes/special/SpecialNotificationsMarkRead.php
@@ -53,6 +53,10 @@
return $result;
},
'validation-callback' => function ( $value, 
$alldata ) {
+   if ( $value === [ 'ALL' ] ) {
+   // Gotta be a better way to 
handle this
+   return true;
+   }
if ( (int)$value <= 0 ) {
return $this->msg( 
'echo-specialpage-markasread-invalid-id' );
}
@@ -129,10 +133,15 @@
 * @return bool|string|array|Status As documented for 
HTMLForm::trySubmit.
 */
public function onSubmit( array $data /* $form = null */ ) {
+   $notifUser = MWEchoNotifUser::newFromUser( $this->getUser() );
+
+   // Allow for all IDs
+   if ( $data['id'] === [ 'ALL' ] ) {
+   return $notifUser->markAllRead();
+   }
+
// Allow for multiple IDs or a single ID
$ids = $data['id'];
-
-   $notifUser = MWEchoNotifUser::newFromUser( $this->getUser() );
return $notifUser->markRead( $ids );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a62c56306597209540ffd694c8fb7b2a92885c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: MtDu 

[MediaWiki-commits] [Gerrit] mediawiki...RevisionSlider[master]: Reduce confusion for mw.util.getUrl()

2017-08-10 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371116 )

Change subject: Reduce confusion for mw.util.getUrl()
..

Reduce confusion for mw.util.getUrl()

Currently, `this` is passed as the parameter for pageName, making it
seem like getUrl() can take in an object as the first parameter, when
it should be a string. This works right now because of a tertiary
operator that fetches what we need. To reduce confusion, we should
pass null instead.

Change-Id: Ieea30a4933f3e3fdeb8331c5c544bf1eb034e6b7
---
M modules/ext.RevisionSlider.RevisionListView.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/ext.RevisionSlider.RevisionListView.js 
b/modules/ext.RevisionSlider.RevisionListView.js
index df9d0a7..7f00e92 100644
--- a/modules/ext.RevisionSlider.RevisionListView.js
+++ b/modules/ext.RevisionSlider.RevisionListView.js
@@ -242,7 +242,7 @@
.append(
$( '' ).append(
$( '' ).text( mw.msg( 
'revisionslider-label-date' ) + mw.msg( 'colon-separator' ) ),
-   $( '' ).attr( 'href', 
mw.util.getUrl( this, { oldid: revision.id } ) )
+   $( '' ).attr( 'href', 
mw.util.getUrl( null, { oldid: revision.id } ) )
.text( 
revision.getFormattedDate() )
),
this.makeUserLine( revision.getUser(), 
revision.getUserGender() ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieea30a4933f3e3fdeb8331c5c544bf1eb034e6b7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...RevisionSlider[master]: Monobook uses x-small and a globalWrapper to make everything...

2017-08-09 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370828 )

Change subject: Monobook uses x-small and a globalWrapper to make everything 
inside of it appear normal. However, the revslider-tooltips are not inside this 
globalWrapper, and thus need a separate CSS rule.
..

Monobook uses x-small and a globalWrapper to make everything inside
of it appear normal. However, the revslider-tooltips are not inside
this globalWrapper, and thus need a separate CSS rule.

Bug: T166231
Change-Id: I2115688fee75145349e062b9586713a56541afa0
---
M extension.json
A modules/ext.RevisionSlider.modern.css
A modules/ext.RevisionSlider.monobook.css
3 files changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RevisionSlider 
refs/changes/28/370828/1

diff --git a/extension.json b/extension.json
index 6b188b5..7ee0604 100644
--- a/extension.json
+++ b/extension.json
@@ -53,6 +53,14 @@
"styles": [
"modules/ext.RevisionSlider.css"
],
+   "skinStyles": {
+   "monobook": [
+   
"modules/ext.RevisionSlider.monobook.css"
+   ],
+   "modern": [
+   "modules/ext.RevisionSlider.modern.css"
+   ]
+   },
"dependencies": [
"oojs-ui",
"oojs-ui.styles.icons-movement",
diff --git a/modules/ext.RevisionSlider.modern.css 
b/modules/ext.RevisionSlider.modern.css
new file mode 100644
index 000..417c7f9
--- /dev/null
+++ b/modules/ext.RevisionSlider.modern.css
@@ -0,0 +1,7 @@
+/* HACK: Modern uses x-small and a globalWrapper to make everything
+   inside of it appear normal. However, the revslider-tooltips are
+   not inside this globalWrapper, and thus need a separate CSS rule.
+   Once this issue is fixed, this rule can be removed. (T166231) */
+.mw-revslider-tooltip {
+   font-size: 0.8rem;
+}
\ No newline at end of file
diff --git a/modules/ext.RevisionSlider.monobook.css 
b/modules/ext.RevisionSlider.monobook.css
new file mode 100644
index 000..770c350
--- /dev/null
+++ b/modules/ext.RevisionSlider.monobook.css
@@ -0,0 +1,7 @@
+/* HACK: Monobook uses x-small and a globalWrapper to make everything
+   inside of it appear normal. However, the revslider-tooltips are
+   not inside this globalWrapper, and thus need a separate CSS rule.
+   Once this issue is fixed, this rule can be removed. (T166231) */
+.mw-revslider-tooltip {
+   font-size: 0.8rem;
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2115688fee75145349e062b9586713a56541afa0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Add message checker and insertable for Oppia variables

2017-07-04 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363185 )

Change subject: Add message checker and insertable for Oppia variables
..

Add message checker and insertable for Oppia variables

Oppia has variables like <[foo]> which are currently missing a checker and 
insertables support.

Bug: T169173
Change-Id: I0fcd5b98fc8f52514d6b25e8a30a3740b482a42c
---
A groups/Oppia/Checker.php
M groups/Oppia/Oppia.yaml
A groups/Oppia/OppiaInsertablesSuggester.php
3 files changed, 65 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/85/363185/1

diff --git a/groups/Oppia/Checker.php b/groups/Oppia/Checker.php
new file mode 100644
index 000..e902b94
--- /dev/null
+++ b/groups/Oppia/Checker.php
@@ -0,0 +1,26 @@
+/' );
+   }
+}
\ No newline at end of file
diff --git a/groups/Oppia/Oppia.yaml b/groups/Oppia/Oppia.yaml
index 46765e6..78458f9 100644
--- a/groups/Oppia/Oppia.yaml
+++ b/groups/Oppia/Oppia.yaml
@@ -12,3 +12,15 @@
   sourcePattern: "%GROUPROOT%/oppia/assets/i18n/%CODE%.json"
   definitionFile: "%GROUPROOT%/oppia/assets/i18n/en.json"
   includeMetadata: false
+
+CHECKER:
+  class: OppiaMessageChecker
+  checks:
+- OppiaVariablesCheck
+
+INSERTABLES:
+  class: OppiaInsertablesSuggester
+
+AUTOLOAD:
+  OppiaMessageChecker: Checker.php
+  OppiaInsertablesSuggester: OppiaInsertablesSuggester.php
diff --git a/groups/Oppia/OppiaInsertablesSuggester.php 
b/groups/Oppia/OppiaInsertablesSuggester.php
new file mode 100644
index 000..b33c4a3
--- /dev/null
+++ b/groups/Oppia/OppiaInsertablesSuggester.php
@@ -0,0 +1,27 @@
+
+   $matches = [];
+   preg_match_all(
+   '/<\[[a-zA-Z_]+\]>/',
+   $text,
+   $matches,
+   PREG_SET_ORDER
+   );
+   $new = array_map( function( $match ) {
+   return new Insertable( $match[0], $match[0] );
+   }, $matches );
+   $insertables = array_merge( $insertables, $new );
+
+   return $insertables;
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0fcd5b98fc8f52514d6b25e8a30a3740b482a42c
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use WANcache instead of $messageMemc when purging feeds

2017-05-24 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355574 )

Change subject: Use WANcache instead of $messageMemc when purging feeds
..

Use WANcache instead of $messageMemc when purging feeds

ChangesFeed was updated in rMW3517be1cf0b7841b6f20d97fbcfa97f8645270a6
to use the WAN cache, so this change updates the purgeFeeds() function
to use the same cache.

Bug: T166195
Change-Id: I28a8d729737f03ccaf069495a59e80401c59e778
---
M maintenance/rebuildrecentchanges.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/74/355574/1

diff --git a/maintenance/rebuildrecentchanges.php 
b/maintenance/rebuildrecentchanges.php
index 458dacf..bcc70d2 100644
--- a/maintenance/rebuildrecentchanges.php
+++ b/maintenance/rebuildrecentchanges.php
@@ -478,15 +478,16 @@
}
 
/**
-* Purge cached feeds in $messageMemc
+* Purge cached feeds in $wanCache
 */
private function purgeFeeds() {
-   global $wgFeedClasses, $messageMemc;
+   global $wgFeedClasses;
 
$this->output( "Deleting feed timestamps.\n" );
 
+   $wanCache = ObjectCache::getMainWANInstance();
foreach ( $wgFeedClasses as $feed => $className ) {
-   $messageMemc->delete( wfMemcKey( 'rcfeed', $feed, 
'timestamp' ) ); # Good enough for now.
+   $wanCache->delete( $wanCache->makeKey( 'rcfeed', $feed, 
'timestamp' ) ); # Good enough for now.
}
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add a maintenance script for populating pp_sortkey

2017-05-24 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355541 )

Change subject: Add a maintenance script for populating pp_sortkey
..

Add a maintenance script for populating pp_sortkey

The addition of a pp_sortkey field in T60032 necessitates an update
to old entries in the page_props table that don't have a pp_sortkey.
The script uses the pp_value as the sort key if it's numeric.

Bug: T66949
Change-Id: Id482dc73ec1963010324e51fe9273a72dd31a7f7
---
A maintenance/populatePPSortKey.php
1 file changed, 96 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/41/355541/1

diff --git a/maintenance/populatePPSortKey.php 
b/maintenance/populatePPSortKey.php
new file mode 100644
index 000..dddc42c
--- /dev/null
+++ b/maintenance/populatePPSortKey.php
@@ -0,0 +1,96 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+use Wikimedia\Rdbms\IDatabase;
+
+/**
+ * Usage:
+ *  PopulatePPSortKey.php
+ */
+class PopulateSortKey extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+   $this->addDescription( 'Populate the pp_sortkey field' );
+   $this->setBatchSize( 100 );
+   }
+
+   public function execute() {
+   $dbw = $this->getDB( DB_MASTER );
+
+   $lastProp = NULL;
+   $lastPageValue = 0;
+
+   while ( true ) {
+   $conditions = [ 'pp_sortkey IS NULL' ];
+   if ( $lastPageValue !== 0 ) {
+   $conditions[] = 'pp_page > ' . $dbw->addQuotes( 
$lastPageValue ) . 'OR' .
+   '( pp_page = 
$lastPage AND pp_propname > $lastProp )';
+   }
+
+   $res = $dbw->select(
+   'page_props',
+   [ 'pp_propname', 'pp_page', 'pp_sortkey', 
'pp_value' ],
+   $conditions,
+   __METHOD__,
+   [ 'ORDER BY' => 'pp_page, pp_propname' ],
+   [ 'LIMIT' => $this->mBatchSize ]
+   );
+
+   if ( $res->numRows() === 0 ) {
+   break;
+   }
+
+   foreach ( $res as $row ) {
+   if ( is_numeric( $row->pp_value ) ) {
+   $dbw->update(
+   'page_props',
+   [ 'pp_sortkey' => 
$row->pp_value ],
+   [
+   'pp_page' = 
$row->pp_page,
+   'pp_propname' = 
$row->pp_propname
+   ],
+   __METHOD__
+   );
+   } else {
+   continue;
+   }
+   }
+
+   $this->output( "Updated " . $res->numRows() . " rows 
\n" );
+
+   wfWaitForSlaves();
+
+   // We need to get the last element's page ID
+   $lastPageValue = $row->pp_value;
+   // And the propname...
+   $lastProp = $row->pp_propname;
+   }
+
+   $this->output( "Done!\n" );
+   }
+}
+
+$maintClass = 'PopulateSortKey';
+require_once RUN_MAINTENANCE_IF_MAIN;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: MessageCache: Avoid deprecated wfMemcKey()

2017-05-24 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355426 )

Change subject: MessageCache: Avoid deprecated wfMemcKey()
..

MessageCache: Avoid deprecated wfMemcKey()

Change-Id: I31e3cde0a94e355de9f32a17636aaf54aa2d40c4
---
M includes/cache/MessageCache.php
1 file changed, 11 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/355426/1

diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 8f88ee9..04b49cd 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -220,7 +220,7 @@
 * @return array|bool The cache array, or false if not in cache.
 */
protected function getLocalCache( $code ) {
-   $cacheKey = wfMemcKey( __CLASS__, $code );
+   $cacheKey = $this->wanCache->makeKey( __CLASS__, $code );
 
return $this->srvCache->get( $cacheKey );
}
@@ -232,7 +232,7 @@
 * @param array $cache The cache array
 */
protected function saveToLocalCache( $code, $cache ) {
-   $cacheKey = wfMemcKey( __CLASS__, $code );
+   $cacheKey = $this->wanCache->makeKey( __CLASS__, $code );
$this->srvCache->set( $cacheKey, $cache );
}
 
@@ -308,7 +308,7 @@
}
 
if ( !$success ) {
-   $cacheKey = wfMemcKey( 'messages', $code ); # Key in 
memc for messages
+   $cacheKey = $cache->makeKey( 'messages', $code ); # Key 
in memc for messages
# Try the global cache. If it is empty, try to acquire 
a lock. If
# the lock can't be acquired, wait for the other thread 
to finish
# and then try the global cache a second time.
@@ -402,7 +402,7 @@
protected function loadFromDBWithLock( $code, array &$where, $mode = 
null ) {
# If cache updates on all levels fail, give up on message 
overrides.
# This is to avoid easy site outages; see $saveSuccess comments 
below.
-   $statusKey = wfMemcKey( 'messages', $code, 'status' );
+   $statusKey = $this->wanCache->makeKey( 'messages', $code, 
'status' );
$status = $this->clusterCache->get( $statusKey );
if ( $status === 'error' ) {
$where[] = "could not load; method is still globally 
disabled";
@@ -416,7 +416,7 @@
# This lock is non-blocking so stale cache can quickly be used.
# Note that load() will call a blocking getReentrantScopedLock()
# after this if it really need to wait for any current thread.
-   $cacheKey = wfMemcKey( 'messages', $code );
+   $cacheKey = $this->wanCache->makeKey( 'messages', $code );
$scopedLock = $this->getReentrantScopedLock( $cacheKey, 0 );
if ( !$scopedLock ) {
$where[] = 'could not acquire main lock';
@@ -596,7 +596,7 @@
function () use ( $title, $msg, $code ) {
global $wgContLang, $wgMaxMsgCacheEntrySize;
// Allow one caller at a time to avoid race 
conditions
-   $scopedLock = $this->getReentrantScopedLock( 
wfMemcKey( 'messages', $code ) );
+   $scopedLock = $this->getReentrantScopedLock( 
$this->wanCache->makeKey( 'messages', $code ) );
if ( !$scopedLock ) {
LoggerFactory::getInstance( 
'MessageCache' )->error(
__METHOD__ . ': could not 
acquire lock to update {title} ({code})',
@@ -628,7 +628,7 @@
 
// Relay the purge. Touching this check key 
expires cache contents
// and local cache (APC) validation hash across 
all datacenters.
-   $this->wanCache->touchCheckKey( wfMemcKey( 
'messages', $code ) );
+   $this->wanCache->touchCheckKey( 
$this->wanCache->makeKey( 'messages', $code ) );
// Also delete cached sidebar... just in case 
it is affected
// @TODO: shouldn't this be $code === 
$wgLanguageCode?
if ( $code === 'en' ) {
@@ -639,7 +639,7 @@
$codes = [ $code ];
}
foreach ( $codes as $code ) {
-   $this->wanCache->delete( wfMemcKey( 
'sidebar', $code ) );
+   $this->wanCache->delete( 
$this->wanCache->makeKey( 'sidebar', $code ) );
}
 
 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid deprecated ObjectCache::getMainWANInstance()

2017-05-23 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355369 )

Change subject: Avoid deprecated ObjectCache::getMainWANInstance()
..

Avoid deprecated ObjectCache::getMainWANInstance()

Use $this->wanCache->makeKey() instead of wfMemcKey()

Change-Id: Iceda42ed4dc7ad30f97f42e0183df8e73f564b14
---
M includes/cache/FileCacheBase.php
M includes/cache/MessageCache.php
2 files changed, 26 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/69/355369/1

diff --git a/includes/cache/FileCacheBase.php b/includes/cache/FileCacheBase.php
index 0a302b6..aecbb2e 100644
--- a/includes/cache/FileCacheBase.php
+++ b/includes/cache/FileCacheBase.php
@@ -21,6 +21,8 @@
  * @ingroup Cache
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Base class for data storage in the file system.
  *
@@ -242,7 +244,13 @@
: IP::sanitizeRange( "$ip/16" );
 
# Bail out if a request already came from this range...
-   $key = wfMemcKey( static::class, 'attempt', 
$this->mType, $this->mKey, $ip );
+   $key = 
MediaWikiServices::getInstance()->getMainWANObjectCache()->makeKey(
+   static::class,
+   'attempt',
+   $this->mType,
+   $this->mKey,
+   $ip
+   );
if ( $cache->get( $key ) ) {
return; // possibly the same user
}
@@ -272,6 +280,11 @@
 * @return string
 */
protected function cacheMissKey() {
-   return wfMemcKey( static::class, 'misses', $this->mType, 
$this->mKey );
+   return 
MediaWikiServices::getInstance()->getMainWANObjectCache()->makeKey(
+   static::class,
+   'misses',
+   $this->mType,
+   $this->mKey
+   );
}
 }
diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 8f88ee9..a5dd77d 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -114,7 +114,6 @@
if ( self::$instance === null ) {
global $wgUseDatabaseMessages, $wgMsgCacheExpiry, 
$wgUseLocalMessageCache;
self::$instance = new self(
-   
MediaWikiServices::getInstance()->getMainWANObjectCache(),
wfGetMessageCacheStorage(),
$wgUseLocalMessageCache
? 
MediaWikiServices::getInstance()->getLocalServerObjectCache()
@@ -220,7 +219,7 @@
 * @return array|bool The cache array, or false if not in cache.
 */
protected function getLocalCache( $code ) {
-   $cacheKey = wfMemcKey( __CLASS__, $code );
+   $cacheKey = $this->wanCache->makeKey( __CLASS__, $code );
 
return $this->srvCache->get( $cacheKey );
}
@@ -232,7 +231,7 @@
 * @param array $cache The cache array
 */
protected function saveToLocalCache( $code, $cache ) {
-   $cacheKey = wfMemcKey( __CLASS__, $code );
+   $cacheKey = $this->wanCache->makeKey( __CLASS__, $code );
$this->srvCache->set( $cacheKey, $cache );
}
 
@@ -308,7 +307,7 @@
}
 
if ( !$success ) {
-   $cacheKey = wfMemcKey( 'messages', $code ); # Key in 
memc for messages
+   $cacheKey = $this->wanCache->makeKey( 'messages', $code 
); # Key in memc for messages
# Try the global cache. If it is empty, try to acquire 
a lock. If
# the lock can't be acquired, wait for the other thread 
to finish
# and then try the global cache a second time.
@@ -402,7 +401,7 @@
protected function loadFromDBWithLock( $code, array &$where, $mode = 
null ) {
# If cache updates on all levels fail, give up on message 
overrides.
# This is to avoid easy site outages; see $saveSuccess comments 
below.
-   $statusKey = wfMemcKey( 'messages', $code, 'status' );
+   $statusKey = $this->wanCache->makeKey( 'messages', $code, 
'status' );
$status = $this->clusterCache->get( $statusKey );
if ( $status === 'error' ) {
$where[] = "could not load; method is still globally 
disabled";
@@ -416,7 +415,7 @@
# This lock is non-blocking so stale cache can quickly be used.
# Note that load() will call a blocking getReentrantScopedLock()
# after this if it really need to wait for any 

[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Allow one line closures for functions

2017-05-23 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355368 )

Change subject: Allow one line closures for functions
..

Allow one line closures for functions

Bug: T154789
Change-Id: I0ca889398761d70b3639a74230745b58c1b41760
---
M MediaWiki/ruleset.xml
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/68/355368/1

diff --git a/MediaWiki/ruleset.xml b/MediaWiki/ruleset.xml
index 5b7bcaa..0c2d820 100644
--- a/MediaWiki/ruleset.xml
+++ b/MediaWiki/ruleset.xml
@@ -40,7 +40,8 @@



-   
+   
+   


0
@@ -102,7 +103,8 @@
-->


-   
+   
+   




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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ca889398761d70b3639a74230745b58c1b41760
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Actually get the Newsletter name by using $this->newsletter

2017-05-21 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354920 )

Change subject: Actually get the Newsletter name by using $this->newsletter
..

Actually get the Newsletter name by using $this->newsletter

Before, $this->getName() is called, but that does not exist.
Now, calling $this->newsletter->getName() actually gets the name

Bug: T159081
Change-Id: Idd01eaf8b0d364dd72659d6bf4c9201e61b77fa4
---
M includes/NewsletterEditPage.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/includes/NewsletterEditPage.php b/includes/NewsletterEditPage.php
index ac7f5d8..8cd0cc8 100644
--- a/includes/NewsletterEditPage.php
+++ b/includes/NewsletterEditPage.php
@@ -40,7 +40,7 @@
 
$this->out->setPageTitle(
$this->context->msg( 'newsletter-manage' )
-   ->params( $this->getName() )
+   ->params( $this->newsletter->getName() )
);
 
$this->getManageForm()->show();
@@ -135,7 +135,7 @@
$form->setAction( $this->title->getLocalURL( 'action=submit' ) 
);
$form->addHeaderText(
$this->context->msg( 'newsletter-manage-text' )
-   ->params( $this->getName() )->parse()
+   ->params( $this->newsletter->getName() 
)->parse()
);
$form->setId( 'newsletter-manage-form' );
$form->setSubmitID( 'newsletter-manage-button' );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Check if makeTitleSafe returns null in getNewsletterUrl()

2017-05-21 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354907 )

Change subject: Check if makeTitleSafe returns null in getNewsletterUrl()
..

Check if makeTitleSafe returns null in getNewsletterUrl()

Bug: T159081
Change-Id: I77c595d1e6314f456684e8900d700383bf1ec3ca
---
M includes/Echo/BaseNewsletterPresentationModel.php
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/includes/Echo/BaseNewsletterPresentationModel.php 
b/includes/Echo/BaseNewsletterPresentationModel.php
index d88c6f5..b0555d6 100644
--- a/includes/Echo/BaseNewsletterPresentationModel.php
+++ b/includes/Echo/BaseNewsletterPresentationModel.php
@@ -15,6 +15,10 @@
}
 
protected function getNewsletterUrl() {
-   return Title::makeTitleSafe( NS_NEWSLETTER, 
$this->getNewsletterName() )->getFullURL();
+   $result = Title::makeTitleSafe( NS_NEWSLETTER, 
$this->getNewsletterName() )->getFullURL();
+   if( !$result ) {
+   throw new MWException( 'Cannot find newsletter with 
name \"' . $this->getNewsletterName() . '\"' );
+   }
+   return $result;
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Use params and getName instead of rawParams and getEscapedName

2017-05-21 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354901 )

Change subject: Use params and getName instead of rawParams and getEscapedName
..

Use params and getName instead of rawParams and getEscapedName

Before, getEscapedName escapes the message, but rawParams
immediately unescapes it, so this eliminates that redundancy.

Bug: T159081
Change-Id: I44263e4f08003b9d42f569c968634ece151e05c1
---
M includes/NewsletterEditPage.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/includes/NewsletterEditPage.php b/includes/NewsletterEditPage.php
index a945778..ac7f5d8 100644
--- a/includes/NewsletterEditPage.php
+++ b/includes/NewsletterEditPage.php
@@ -40,7 +40,7 @@
 
$this->out->setPageTitle(
$this->context->msg( 'newsletter-manage' )
-   ->rawParams( $this->getEscapedName() )
+   ->params( $this->getName() )
);
 
$this->getManageForm()->show();
@@ -135,7 +135,7 @@
$form->setAction( $this->title->getLocalURL( 'action=submit' ) 
);
$form->addHeaderText(
$this->context->msg( 'newsletter-manage-text' )
-   ->rawParams( $this->getEscapedName() )->parse()
+   ->params( $this->getName() )->parse()
);
$form->setId( 'newsletter-manage-form' );
$form->setSubmitID( 'newsletter-manage-button' );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Add newsletter-restore as an action and right

2017-05-21 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354898 )

Change subject: Add newsletter-restore as an action and right
..

Add newsletter-restore as an action and right

Before, there is validation to check if a user can restore a newsletter, but 
the right/action does not exist, so it is useless. This patch adds these so 
that it both displays on Special:GroupRights and validadtion works properly.

Bug: T159081
Change-Id: Ia9277359a3e54c63c760a5dafc04c522aefe73a3
---
M extension.json
M i18n/en.json
M i18n/qqq.json
3 files changed, 8 insertions(+), 2 deletions(-)


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

diff --git a/extension.json b/extension.json
index 34de892..96fe06b 100644
--- a/extension.json
+++ b/extension.json
@@ -13,13 +13,15 @@
"AvailableRights": [
"newsletter-create",
"newsletter-delete",
-   "newsletter-manage"
+   "newsletter-manage",
+   "newsletter-restore"
],
"GroupPermissions": {
"sysop": {
"newsletter-create": true,
"newsletter-delete": true,
-   "newsletter-manage": true
+   "newsletter-manage": true,
+   "newsletter-restore": true
}
},
"RateLimits": {
diff --git a/i18n/en.json b/i18n/en.json
index cb26a3e..df54c14 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -119,6 +119,8 @@
"action-newsletter-delete": "delete newsletters",
"right-newsletter-manage": "Add or remove publishers or subscribers 
from newsletters",
"action-newsletter-manage": "manage newsletters",
+   "right-newsletter-restore": "Restore a newsletter",
+   "action-newsletter-restore": "retore a newsletter",
"apihelp-newslettersubscribe-description": "Subscribe to or unsubscribe 
from a newsletter.",
"apihelp-newslettersubscribe-param-id": "ID of the newsletter for which 
the subscription should be changed.",
"apihelp-newslettersubscribe-param-do": "Action to do. Should be either 
subscribe or unsubscribe.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a095c2b..07b3ed7 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -126,6 +126,8 @@
"action-newsletter-delete": "{{doc-action|newsletter-delete}}",
"right-newsletter-manage": "{{doc-right|newsletter-manage}}",
"action-newsletter-manage": "{{doc-action|newsletter-manage}}",
+   "right-newsletter-restore": "{{doc-right|newsletter-restore}}",
+   "action-newsletter-restore": "{{doc-action|newsletter-restore}}",
"apihelp-newslettersubscribe-description": 
"{{doc-apihelp-description|newslettersubscribe}}",
"apihelp-newslettersubscribe-param-id": 
"{{doc-apihelp-param|newslettersubscribe|id}}",
"apihelp-newslettersubscribe-param-do": 
"{{doc-apihelp-param|newslettersubscribe|do}}",

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Don't suggest pages that don't exist for mainpage

2017-05-21 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354897 )

Change subject: Don't suggest pages that don't exist for mainpage
..

Don't suggest pages that don't exist for mainpage

Bug: T159081
Change-Id: I40c6f27aa6cb13dcef662b361493160361e24009
---
M includes/specials/SpecialNewsletterCreate.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/includes/specials/SpecialNewsletterCreate.php 
b/includes/specials/SpecialNewsletterCreate.php
index 0651a03..1786086 100644
--- a/includes/specials/SpecialNewsletterCreate.php
+++ b/includes/specials/SpecialNewsletterCreate.php
@@ -48,6 +48,7 @@
'maxlength' => 120,
],
'mainpage' => [
+   'exists' => true,
'type' => 'title',
'required' => true,
'label-message' => 'newsletter-title',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Improve UI for blacklist preference

2017-05-20 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354695 )

Change subject: Improve UI for blacklist preference
..

Improve UI for blacklist preference

Bug: T150419
Change-Id: I4c872960efd858d2885f1ee9163047c449f4f212
---
M Hooks.php
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/Hooks.php b/Hooks.php
index f3cb933..05bedb6 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -485,7 +485,7 @@
 
if ( $wgEchoPerUserBlacklist ) {
$preferences['echo-notifications-blacklist'] = [
-   'type' => 'textarea',
+   'type' => 'usersmultiselect',
'label-message' => 
'echo-pref-notifications-blacklist',
'section' => 'echo/blocknotificationslist',
];
@@ -851,6 +851,10 @@
] );
}
 
+   if ( $out->getTitle()->isSpecial( 'Preferences' ) ) {
+   $out->addModules( [ 'ext.echo.preferences' ] );
+   }
+
return true;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c872960efd858d2885f1ee9163047c449f4f212
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Use newsletter-unsubscribe-text instead of newsletter-subscr...

2017-05-19 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354553 )

Change subject: Use newsletter-unsubscribe-text instead of 
newsletter-subscribe-text
..

Use newsletter-unsubscribe-text instead of newsletter-subscribe-text

Bug: T159081
Change-Id: Ib87003326e475cda25f55255f29caf4fd4359326
---
M includes/specials/SpecialNewsletter.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/specials/SpecialNewsletter.php 
b/includes/specials/SpecialNewsletter.php
index a92a5f6..1225aa5 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -198,7 +198,7 @@
 
if ( $this->newsletter->isSubscribed( $this->getUser() ) ) {
// User is subscribed so show the unsubscribe form
-   $txt = $this->msg( 'newsletter-subscribe-text' )
+   $txt = $this->msg( 'newsletter-unsubscribe-text' )
->rawParams( $this->getEscapedName() )->parse();
$button = [
'unsubscribe' => [

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Use INNER JOIN instead of LEFT JOIN because INNER JOIN does ...

2017-05-19 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354461 )

Change subject: Use INNER JOIN instead of LEFT JOIN because INNER JOIN does not 
include unmatched entries, whereas left returns null when there is no match.
..

Use INNER JOIN instead of LEFT JOIN because INNER JOIN does not include 
unmatched entries, whereas left returns null when there is no match.

Bug: T159081
Change-Id: I97e950e493ecd3dfdeed7944a2ccd37fea224bd0
---
M includes/NewsletterDb.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php
index 9cf1494..d519947 100644
--- a/includes/NewsletterDb.php
+++ b/includes/NewsletterDb.php
@@ -385,7 +385,7 @@
[ 'nlp_publisher_id' => $user->getId(), 'nl_active' => 
1 ],
__METHOD__,
[],
-   [ 'nl_newsletters' => [ 'LEFT JOIN', 
'nl_id=nlp_newsletter_id' ] ]
+   [ 'nl_newsletters' => [ 'INNER JOIN', 
'nl_id=nlp_newsletter_id' ] ]
);
$this->lb->reuseConnection( $dbr );
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMaintenance[master]: Add license, description message and create and load i18n me...

2017-05-17 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354174 )

Change subject: Add license, description message and create and load i18n 
messages
..

Add license, description message and create and load i18n messages

Change-Id: I6d49df614f53dd2fb381dc5c1d7d0b6b0e4310b5
---
M extension.json
A i18n/en.json
2 files changed, 11 insertions(+), 1 deletion(-)


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

diff --git a/extension.json b/extension.json
index 194c7e3..9602f2b 100644
--- a/extension.json
+++ b/extension.json
@@ -1,4 +1,11 @@
 {
"name": "WikimediaMaintenance",
-   "manifest_version": 1
+   "manifest_version": 1,
+   "license-name": "GPL-2.0+",
+   "descriptionmsg": "wikimediamaintenance-desc",
+   "MessagesDirs": {
+   "WikimediaMaintenance": [
+   "i18n"
+   ]
+   }
 }
diff --git a/i18n/en.json b/i18n/en.json
new file mode 100644
index 000..0e95dc6
--- /dev/null
+++ b/i18n/en.json
@@ -0,0 +1,3 @@
+{
+   "wikimediamaintenance-desc": "Provides a collection of scripts that is 
mainly used by Wikimedia"
+}
\ No newline at end of file

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

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

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


[MediaWiki-commits] [Gerrit] labs...wikibugs2[master]: Wikibugs realname should use HTTPS over HTTP

2017-03-27 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/345087 )

Change subject: Wikibugs realname should use HTTPS over HTTP
..

Wikibugs realname should use HTTPS over HTTP

Bug: T161421
Change-Id: I1567e05fceb4b302cda1685f806e3d28366ffbdd
---
M redis2irc.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 
refs/changes/87/345087/1

diff --git a/redis2irc.py b/redis2irc.py
index 01d73ce..c617a4a 100644
--- a/redis2irc.py
+++ b/redis2irc.py
@@ -150,7 +150,7 @@
 port=6667,
 password=conf.get('IRC_PASSWORD'),
 realname='wikibugs2',
-userinfo=('Wikibugs v2.1, http://tools.wmflabs.org/wikibugs/ ,' +
+userinfo=('Wikibugs v2.1, https://tools.wmflabs.org/wikibugs/ ,' +
   'running on ' + current_host),
 includes=[
 'irc3.plugins.core',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1567e05fceb4b302cda1685f806e3d28366ffbdd
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/wikibugs2
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Support loading of secondary icons in RLEIM module

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

Change subject: Support loading of secondary icons in RLEIM module
..

Support loading of secondary icons in RLEIM module

Before, secondary icons, such as linked, changes, thanks, and
userSpeechBubble were loaded in mw.echo.ui.icons.less. Now, an
extra icons attribute is passed when the module is loaded, allowing
RLEIM to know which icons to load. If this attribute is left out,
an MWException will be thrown.

Bug: T159394
Change-Id: I9b36a74bcf1da0d1c698845bd067b226fb81ac96
---
M Hooks.php
M extension.json
M includes/ResourceLoaderEchoImageModule.php
D modules/styles/mw.echo.ui.icons.less
4 files changed, 37 insertions(+), 22 deletions(-)


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

diff --git a/Hooks.php b/Hooks.php
index bb87919..50a4f47 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -155,8 +155,18 @@
$resourceLoader->register( 'ext.echo.logger', $definition );
 
global $wgExtensionDirectory;
+   global $wgEchoNotificationIcons;
+   global $wgEchoSecondaryIcons;
$resourceLoader->register( 'ext.echo.emailicons', [
'class' => 'ResourceLoaderEchoImageModule',
+   'icons' => $wgEchoNotificationIcons,
+   'selector' => '.mw-echo-icon-{name}',
+   'localBasePath' => $wgExtensionDirectory,
+   'remoteExtPath' => 'Echo/modules'
+   ] );
+   $resourceLoader->register( 'ext.echo.secondaryicons', [
+   'class' => 'ResourceLoaderEchoImageModule',
+   'icons' => $wgEchoSecondaryIcons,
'selector' => '.mw-echo-icon-{name}',
'localBasePath' => $wgExtensionDirectory,
'remoteExtPath' => 'Echo/modules'
diff --git a/extension.json b/extension.json
index 979ef4e..26128c8 100644
--- a/extension.json
+++ b/extension.json
@@ -219,7 +219,6 @@
],
"styles": [
"styles/mw.echo.ui.overlay.less",
-   "styles/mw.echo.ui.icons.less",
"styles/mw.echo.ui.NotificationItemWidget.less",

"styles/mw.echo.ui.ToggleReadCircleButtonWidget.less",

"styles/mw.echo.ui.CrossWikiNotificationItemWidget.less",
@@ -251,6 +250,7 @@
"ext.echo.logger",
"ext.echo.styles.notifications",
"ext.echo.controller",
+   "ext.echo.secondaryicons",
"oojs-ui-core",
"oojs-ui-widgets",
"moment",
@@ -781,6 +781,25 @@
},
"merge_strategy": "array_plus_2d"
},
+   "EchoSecondaryIcons": {
+   "value": {
+   "linked": {
+   "path": 
"Echo/modules/icons/link-blue.svg"
+   },
+   "changes": {
+   "path": "Echo/modules/icons/changes.svg"
+   },
+   "thanks": {
+   "path": {
+   "ltr": 
"Echo/modules/icons/thanks-ltr.svg",
+   "rtl": 
"Echo/modules/icons/thanks-rtl.svg"
+   }   },
+   "userSpeechBubble": {
+   "path": 
"Echo/modules/icons/user-speech-bubble.svg"
+   }
+   },
+   "merge_strategy": "array_plus_2d"
+   },
"EchoNotifications": {
"value": {
"welcome": {
diff --git a/includes/ResourceLoaderEchoImageModule.php 
b/includes/ResourceLoaderEchoImageModule.php
index a243818..b5b8ba3 100644
--- a/includes/ResourceLoaderEchoImageModule.php
+++ b/includes/ResourceLoaderEchoImageModule.php
@@ -24,16 +24,19 @@
  */
 class ResourceLoaderEchoImageModule extends ResourceLoaderImageModule {
protected function loadFromDefinition() {
-   global $wgEchoNotificationIcons;
-
if ( $this->definition === null ) {
return;
}
 
+   // Check to make sure icons are set
+   if ( !isset( $this->definition['icons'] ) ) {
+   throw new MWException('Icons must be 

[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Use data-mw-newsletter-id instead of data-newsletter-id

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

Change subject: Use data-mw-newsletter-id instead of data-newsletter-id
..

Use data-mw-newsletter-id instead of data-newsletter-id

According to Bawolff, data attributes that are not user controlled
should use data-mw. This prevents users from forging data attributes.
Although this may not actually be an issue, following convention will
help future proof things that might change in future patches.

Bug: T159085
Change-Id: I71739ce1f262a40d58ab931d7c84a5ce98b1ad2b
---
M includes/specials/pagers/NewsletterTablePager.php
M modules/ext.newsletter.newsletters.js
2 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/includes/specials/pagers/NewsletterTablePager.php 
b/includes/specials/pagers/NewsletterTablePager.php
index 1e85d51..62f9679 100644
--- a/includes/specials/pagers/NewsletterTablePager.php
+++ b/includes/specials/pagers/NewsletterTablePager.php
@@ -109,7 +109,7 @@
$this->msg( 
'newsletter-unsubscribe-button' )->text(),
array(
'class' => 
'newsletter-subscription newsletter-subscribed',
-   'data-newsletter-id' => 
$id
+   'data-mw-newsletter-id' 
=> $id
)
);
} else {
@@ -121,7 +121,7 @@
$this->msg( 
'newsletter-subscribe-button' )->text(),
array(
'class' => 
'newsletter-subscription newsletter-unsubscribed',
-   'data-newsletter-id' => 
$id
+   'data-mw-newsletter-id' 
=> $id
)
);
}
diff --git a/modules/ext.newsletter.newsletters.js 
b/modules/ext.newsletter.newsletters.js
index 3fb655c..30affe0 100644
--- a/modules/ext.newsletter.newsletters.js
+++ b/modules/ext.newsletter.newsletters.js
@@ -55,7 +55,7 @@
$subscriberCount, promise;
 
if ( /\D/.test( newsletterId ) ) {
-   throw new Error( '"data-newsletter-id" 
attribute must be numeric' );
+   throw new Error( '"data-mw-newsletter-id" 
attribute must be numeric' );
}
$subscriberCount = $( '#nl-count-' + newsletterId );
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix tags not being set in Special:Block

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

Change subject: Fix tags not being set in Special:Block
..

Fix tags not being set in Special:Block

Currently, a PHP error is thrown when tags are not set
in Special:Block on line 832. This patch fixes this
by using a tertiary operator and passing an empty
array if the tags are not set.

Bug: T156486
Change-Id: Ib8722bffbcac5953263ded41eceb3d389d0932f0
---
M includes/api/ApiBlock.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/334664/1

diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php
index 58e3d1c..371672a 100644
--- a/includes/api/ApiBlock.php
+++ b/includes/api/ApiBlock.php
@@ -110,7 +110,7 @@
'Reblock' => $params['reblock'],
'Watch' => $params['watchuser'],
'Confirm' => true,
-   'Tags' => $params['tags'],
+   'Tags' => $params['tags'] ?: [],
];
 
$retval = SpecialBlock::processForm( $data, $this->getContext() 
);

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Extend floating dialog duration to 10s

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

Change subject: Extend floating dialog duration to 10s
..

Extend floating dialog duration to 10s

Currently, the subscribe/unsubscribe floating dialog is shown for 5s.
This is too short to be effective, often not allowing reader to read it.
This patch extends this to 10s. This is made possible by 
https://gerrit.wikimedia.org/r/#/c/331989/2

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


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

diff --git a/modules/ext.newsletter.newsletters.js 
b/modules/ext.newsletter.newsletters.js
index 3fb655c..035d4bb 100644
--- a/modules/ext.newsletter.newsletters.js
+++ b/modules/ext.newsletter.newsletters.js
@@ -76,14 +76,14 @@
$subscriberCount.text( 
parseInt( $subscriberCount.text() ) - 1 );
mw.notify(
mw.msg( 
'newsletter-unsubscribe-success', data.newslettersubscribe.name ),
-   { autoHide: false }
+   { autoHideSeconds: 10 }
);
} )
.fail( function () {
updateLinkAttribs( $link, 
'unsubscribe' );
mw.notify(
mw.msg( 
'newsletter-unsubscribe-error' ),
-   { type: 'error', 
autoHide: false }
+   { type: 'error', 
autoHideSeconds: 10 }
);
} );
} else {
@@ -95,14 +95,14 @@
$subscriberCount.text( 
parseInt( $subscriberCount.text() ) + 1 );
mw.notify(
mw.msg( 
'newsletter-subscribe-success', data.newslettersubscribe.name ),
-   { autoHide: false }
+   { autoHideSeconds: 10 }
);
} )
.fail( function () {
updateLinkAttribs( $link, 
'subscribe' );
mw.notify(
mw.msg( 
'newsletter-subscribe-error' ),
-   { type: 'error', 
autoHide: false }
+   { type: 'error', 
autoHideSeconds: 10 }
);
} );
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove wfIncrStats logging from Special:MobileOptions

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

Change subject: Remove wfIncrStats logging from Special:MobileOptions
..

Remove wfIncrStats logging from Special:MobileOptions

Currently, we log mobile preference updates using wfIncrStats.
However, this is made redundant because of T122504.
As a result, this patch removes these unnecessary calls.

Bug: T132134
Change-Id: I14d05a7ec78f88fdc21d3550300b01a1329c4078
---
M includes/specials/SpecialMobileOptions.php
1 file changed, 0 insertions(+), 3 deletions(-)


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

diff --git a/includes/specials/SpecialMobileOptions.php 
b/includes/specials/SpecialMobileOptions.php
index 7d91ecb..d3a62de 100644
--- a/includes/specials/SpecialMobileOptions.php
+++ b/includes/specials/SpecialMobileOptions.php
@@ -38,7 +38,6 @@
parent::execute( $par );
$context = MobileContext::singleton();
 
-   wfIncrStats( 'mobile.options.views' );
$this->returnToTitle = Title::newFromText( 
$this->getRequest()->getText( 'returnto' ) );
if ( !$this->returnToTitle ) {
$this->returnToTitle = Title::newMainPage();
@@ -243,7 +242,6 @@
 
if ( $user->isLoggedIn() && !$user->matchEditToken( 
$request->getVal( 'token' ) ) ) {
$errorText = __METHOD__ . '(): token mismatch';
-   wfIncrStats( 'mobile.options.errors' );
wfDebugLog( 'mobile', $errorText );
$this->getOutput()->addHTML( ''
. $this->msg( "mobile-frontend-save-error" 
)->parse()
@@ -255,7 +253,6 @@
$this->addSettingsForm();
return;
}
-   wfIncrStats( 'mobile.options.saves' );
 
if ( $request->getBool( 'enableBeta' ) ) {
$group = 'beta';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14d05a7ec78f88fdc21d3550300b01a1329c4078
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove VisualEditor browser test inside MobileFrontend

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

Change subject: Remove VisualEditor browser test inside MobileFrontend
..

Remove VisualEditor browser test inside MobileFrontend

There is a test in tests/browser/features/editor_ve.feature.
However, it is skipped on all environments. This patch removes this test.

Bug: T150338
Change-Id: I58152a592b3ca94586907d4e852055db10308a85
---
D tests/browser/features/editor_ve.feature
1 file changed, 0 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/82/332082/1

diff --git a/tests/browser/features/editor_ve.feature 
b/tests/browser/features/editor_ve.feature
deleted file mode 100644
index fb5e845..000
--- a/tests/browser/features/editor_ve.feature
+++ /dev/null
@@ -1,23 +0,0 @@
-@chrome @editing @en.m.wikipedia.beta.wmflabs.org @extension-visualeditor 
@firefox @skip @vagrant @login
-Feature: VisualEditor Mobile
-
-  # Tests are skipped due to https://phabricator.wikimedia.org/T88559
-  Background:
-Given I am logged into the mobile website
-  And I am in beta mode
-  And I am editing a new article with VisualEditor
-
-  Scenario: Switch from VisualEditor to source editor
-When I switch to editing the source
-  And I see the wikitext editor overlay
-  And I click the wikitext editor overlay close button
-Then I should not see the wikitext editor overlay
-
-  Scenario: I can edit a page using VisualEditor
-When I edit the article using VisualEditor
-Then I should see the edit reflected in the article content
-
-  Scenario: Going back from save screen in VisualEditor
-When I click the escape button
-Then I should see the article content
-  And I should no longer see the VisualEditor

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58152a592b3ca94586907d4e852055db10308a85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...MultiUpload[master]: Add missing apihelp messages to the MultiUpload Extension

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

Change subject: Add missing apihelp messages to the MultiUpload Extension
..

Add missing apihelp messages to the MultiUpload Extension

Tests are failing because of missing apihelp-messages.
This patch adds apihelp description as well as parameter messages.
In addition, a qqq.json file has been added, albeit with some empty values.

Bug: T154606
Change-Id: Ibc27274f129df8cb9737a9d0379c273474637ac5
---
M i18n/en.json
A i18n/qqq.json
2 files changed, 29 insertions(+), 1 deletion(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index 7a8147c..268ae50 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -18,5 +18,8 @@
"multiupload-unpack-error": "Error unpacking package file",
"multiupload-unreadable-package": "Can't read file $1",
"multiupload-http-error": "Couldn't connect to server.",
-   "multiupload-file-unpacked-from": "File $1 from package 
$2"
+   "multiupload-file-unpacked-from": "File $1 from package 
$2",
+   "apihelp-multiupload-unpack-description": "Unpack a zip or tar file 
before importing its contents.",
+   "apihelp-multiupload-unpack-param-key": "\"filekey\" obtained when 
uploading the package file to stash",
+   "apihelp-multiupload-unpack-param-filename": "filename of the package"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
new file mode 100644
index 000..7502ed6
--- /dev/null
+++ b/i18n/qqq.json
@@ -0,0 +1,25 @@
+{
+   "@metadata": {
+   "authors": [
+   "Justin Du"
+   ]
+   },
+   "multiupload": "Message displayed on the legend in Special:MultiUpload",
+   "multiupload-desc": "Description of the MultiUpload extension",
+   "multiupload-text": "Pretext shown in an UploadForm instance of 
MultiUpload.",
+   "multipleupload": "Alias for multiupload",
+   "multipleupload-toolbox": "",
+   "multiupload-submit": "Message shown on the submit button of the 
MultiUpload form.",
+   "multiupload-uploadedto": "Success message shown when a file has been 
successfully uploaded using Special:MultiUpload.",
+   "multiupload-row": "",
+   "multiupload-unpack-button": "Label message for the unpack button.",
+   "multiupload-notify-ok": "Message shown in a dialog displayed to the 
user.",
+   "multiupload-upload-package-error": "Error message shown when a package 
has failed to upload.",
+   "multiupload-unpack-error": "Error message shown when a package has 
failed to be unpacked on the server.",
+   "multiupload-unreadable-package": "",
+   "multiupload-http-error": "HTTP Connection error message.",
+   "multiupload-file-unpacked-from": "Message shown when filed have 
successfully been unpacked.",
+   "apihelp-multiupload-unpack-description": 
"{{doc-apihelp-description|multiupload-unpack}}",
+   "apihelp-multiupload-unpack-param-key": 
"{{doc-apihelp-param|multiupload-unpack|key}}",
+   "apihelp-multiupload-unpack-param-filename": 
"{{doc-apihelp-param|multiupload-unpack|filename}}"
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc27274f129df8cb9737a9d0379c273474637ac5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultiUpload
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Bump requirement to MW 1.25+

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

Change subject: Bump requirement to MW 1.25+
..

Bump requirement to MW 1.25+

Follows up I9d46ba835726e7099aab39e032ab29a2a9f86e02

Change-Id: I20963d0a485d92dca39536dea7bfab54789aa474
---
M extension.json
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/extension.json b/extension.json
index d7775af..5f267ea 100644
--- a/extension.json
+++ b/extension.json
@@ -9,6 +9,9 @@
"descriptionmsg": "lqt-desc",
"type": "other",
"license-name": "GPL-2.0+",
+   "requires": {
+   "MediaWiki": ">= 1.25.0"
+   },
"namespaces": [
{
"id": 90,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ActiveAbstract[master]: Bump requirement to MW 1.25+

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

Change subject: Bump requirement to MW 1.25+
..

Bump requirement to MW 1.25+

Follows up Ideff34ca76fff35100d820ccad83e027c0864881

Change-Id: I2f145cf3e91590936c0f86f8f9763c78bdd6c2c5
---
M extension.json
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ActiveAbstract 
refs/changes/15/330915/1

diff --git a/extension.json b/extension.json
index b06a7a9..95861eb 100644
--- a/extension.json
+++ b/extension.json
@@ -7,6 +7,9 @@
"descriptionmsg": "activeabstract-desc",
"license-name": "GPL-2.0+",
"type": "other",
+   "requires": {
+   "MediaWiki": ">= 1.25.0"
+   },
"MessagesDirs": {
"ActiveAbstract": [
"i18n"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f145cf3e91590936c0f86f8f9763c78bdd6c2c5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ActiveAbstract
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...PhpTags[master]: Disable the following phpunit tests as they are failing * te...

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

Change subject: Disable the following phpunit tests as they are failing * 
testRun_foreach_9 * testRun_foreach_10 * testRun_foreach_11
..

Disable the following phpunit tests as they are failing
* testRun_foreach_9
* testRun_foreach_10
* testRun_foreach_11

Needed for I2c39f90b3094ed1e2c25f58d8e016a9c11575095

Change-Id: Ia2809d00afb37e2ffd9fca73ca795a9f003c
---
M tests/phpunit/includes/RuntimeTest.php
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/tests/phpunit/includes/RuntimeTest.php 
b/tests/phpunit/includes/RuntimeTest.php
index 7a6129d..70fc70f 100644
--- a/tests/phpunit/includes/RuntimeTest.php
+++ b/tests/phpunit/includes/RuntimeTest.php
@@ -3433,18 +3433,21 @@
);
}
public function testRun_foreach_9() {
+   $this->markTestSkipped( 'broken' );
$this->assertEquals(
Runtime::runSource('$a=array(); $a[0][0]="a"; 
$a[0][1]="b"; $a[1][0]="y"; $a[1][1]="z"; foreach ($a as $v1) { foreach ($v1 as 
$v2) { echo $v2; } }'),
array('a', 'b', 'y', 'z')
);
}
public function testRun_foreach_10() {
+   $this->markTestSkipped( 'broken' );
$this->assertEquals(
Runtime::runSource('foreach ($a as $v1) foreach 
($v1 as $v2) { echo $v2; }'),
array('a', 'b', 'y', 'z')
);
}
public function testRun_foreach_11() {
+   $this->markTestSkipped( 'broken' );
$this->assertEquals(
Runtime::runSource('foreach ($a as $v1) foreach 
($v1 as $v2) echo $v2;'),
array('a', 'b', 'y', 'z')

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2809d00afb37e2ffd9fca73ca795a9f003c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTags
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...PhpTags[master]: DO NOT MERGE (Checking tests)

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

Change subject: DO NOT MERGE (Checking tests)
..

DO NOT MERGE (Checking tests)

Change-Id: I9a2fc18c3d6fdfbc0e9f548d9850666a11408fa0
---
M PhpTags.hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhpTags 
refs/changes/01/330901/1

diff --git a/PhpTags.hooks.php b/PhpTags.hooks.php
index 2092ca1..6fa5fa1 100644
--- a/PhpTags.hooks.php
+++ b/PhpTags.hooks.php
@@ -107,7 +107,7 @@
$wgPhpTagsCallsCounter = 0;
 
define ( 'PHPTAGS_HOOK_RELEASE', 8 );
-   define ( 'PHPTAGS_VERSION', '5.9' ); //@todo remove later, it 
only for backward compatibility
+   define ( 'PHPTAGS_VERSION', '5.9' ); // @todo remove later, it 
only for backward compatibility
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a2fc18c3d6fdfbc0e9f548d9850666a11408fa0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTags
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Migrate away from UtfNormal in core to external UtfNormal li...

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

Change subject: Migrate away from UtfNormal in core to external UtfNormal 
library
..

Migrate away from UtfNormal in core to external UtfNormal library

In MediaWiki version 1.25, the UtfNormal library was split into a separate 
wikimedia/utfnormal package.
This patch changes the code to reflect this change.

Bug: T153994
Change-Id: Idb3de58664c5c9e439da0e76c715496f2539e39d
---
M ffs/SimpleFFS.php
1 file changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/ffs/SimpleFFS.php b/ffs/SimpleFFS.php
index fefef3e..230524f 100644
--- a/ffs/SimpleFFS.php
+++ b/ffs/SimpleFFS.php
@@ -12,6 +12,9 @@
  * Other FFS classes can extend SimpleFFS and override suitable methods.
  * @ingroup FFS
  */
+
+use UtfNormal\Validator;
+
 class SimpleFFS implements FFS {
public function supportsFuzzy() {
return 'no';
@@ -117,7 +120,7 @@
throw new MWException( "Contents of $filename are not 
valid utf-8." );
}
 
-   $input = UtfNormal::cleanUp( $input );
+   $input = Validator::cleanUp( $input );
 
try {
return $this->readFromVariable( $input );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb3de58664c5c9e439da0e76c715496f2539e39d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Transliterator[master]: Migrate away from UtfNormal in core to external UtfNormal li...

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

Change subject: Migrate away from UtfNormal in core to external UtfNormal 
library
..

Migrate away from UtfNormal in core to external UtfNormal library

In MediaWiki version 1.25, the UtfNormal library was split into a separate 
wikimedia/utfnormal package.
This patch changes the code to reflect this change.

Bug: T153994
Change-Id: I41553a9c37f89cac552931b28940cbf81d4820e0
---
M Transliterator_body.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Transliterator 
refs/changes/97/330897/1

diff --git a/Transliterator_body.php b/Transliterator_body.php
index 6ca93d7..862bca4 100644
--- a/Transliterator_body.php
+++ b/Transliterator_body.php
@@ -40,6 +40,9 @@
  * Most methods are static, with the exception of those methods that must 
interact (at some level)
  * with the runtime cache of maps, everything else is stateless.
  */
+
+use UtfNormal\Validator;
+
 class ExtTransliterator  {
// These characters have been chosen because they are forbidden by 
MediaWiki, have no special
// regex meaning, are not unicode letters, and take up only one byte.
@@ -216,7 +219,7 @@
$word = Sanitizer::decodeCharReferences( $word );
 
if ( $flags & self::DECOMPOSE ) {
-   $word = UtfNormal::toNFD( $word );
+   $word = Validator::toNFD( $word );
$word = preg_replace( '/./u', '$0' . self::LETTER_END, 
$word );
} else {
$word = preg_replace( '/\X/u', '$0' . self::LETTER_END, 
$word );
@@ -479,7 +482,7 @@
$output = $map['rules']->replace( $word );
 
// Maintain MediaWiki invariant of NFC
-   return UtfNormal::toNFC( $output );
+   return Validator::toNFC( $output );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41553a9c37f89cac552931b28940cbf81d4820e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Transliterator
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...PhpTags[master]: Migrate away from UtfNormal in core to external UtfNormal li...

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

Change subject: Migrate away from UtfNormal in core to external UtfNormal 
library
..

Migrate away from UtfNormal in core to external UtfNormal library

In MediaWiki version 1.25, the UtfNormal library was split into a separate 
wikimedia/utfnormal package.
This patch changes the code to reflect this change.

Bug: T153994
Change-Id: I2c39f90b3094ed1e2c25f58d8e016a9c11575095
---
M includes/Renderer.php
1 file changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/includes/Renderer.php b/includes/Renderer.php
index a994669..371ac19 100644
--- a/includes/Renderer.php
+++ b/includes/Renderer.php
@@ -9,6 +9,9 @@
  * @author Pavel Astakhov 
  * @licence GNU General Public Licence 2.0 or later
  */
+
+use UtfNormal\Validator;
+
 class Renderer {
 
static $cacheHit = 0;
@@ -79,7 +82,7 @@
Timer::stop( $parser );
 
wfProfileOut( __METHOD__ );
-   return \UtfNormal::cleanUp( $return );
+   return Validator::cleanUp( $return );
}
 
public static function runTagHook( $input, array $args, \Parser 
$parser, \PPFrame $frame ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c39f90b3094ed1e2c25f58d8e016a9c11575095
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTags
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...PdfHandler[master]: Migrate away from UtfNormal in core to external UtfNormal li...

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

Change subject: Migrate away from UtfNormal in core to external UtfNormal 
library
..

Migrate away from UtfNormal in core to external UtfNormal library

In MediaWiki version 1.25, the UtfNormal library was split into a separate 
wikimedia/utfnormal package.
This patch changes the code to reflect this change.

Bug: T153994
Change-Id: If4044c38756f96d123cea105312a1863d8b17053
---
M PdfHandler.image.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/PdfHandler.image.php b/PdfHandler.image.php
index ea016e3..2af4d11 100644
--- a/PdfHandler.image.php
+++ b/PdfHandler.image.php
@@ -20,6 +20,7 @@
  */
 
 use MediaWiki\Logger\LoggerFactory;
+use UtfNormal\Validator;
 
 /**
  * inspired by djvuimage from Brion Vibber
@@ -140,7 +141,7 @@
foreach( $pages as $page => $pageText ) {
# Get rid of invalid UTF-8, strip 
control characters
# Note we need to do this per page, as 
\f page feed would be stripped.
-   $pages[$page] = UtfNormal::cleanUp( 
$pageText );
+   $pages[$page] = Validator::cleanUp( 
$pageText );
}
$data['text'] = $pages;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4044c38756f96d123cea105312a1863d8b17053
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PdfHandler
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add a reason field to Special:PageLanguage and ApiSetPageLan...

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

Change subject: Add a reason field to Special:PageLanguage and 
ApiSetPageLanguage
..

Add a reason field to Special:PageLanguage and ApiSetPageLanguage

Most MediaWiki actions allow a user to enter a comment/reason for taking the 
action.
This is logged in the change log. However, currently, both ApiSetPageLanguage 
and Special:PageLanguage do not do thi.
This patch fixes this issue.

Bug: T154644
Change-Id: I6ae021086e1ec4440d6b2894a1b85d62eb36e172
---
M includes/api/ApiSetPageLanguage.php
M includes/api/i18n/en.json
M includes/api/i18n/qqq.json
M includes/specials/SpecialPageLanguage.php
M languages/i18n/en.json
M languages/i18n/qqq.json
6 files changed, 22 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/80/330880/1

diff --git a/includes/api/ApiSetPageLanguage.php 
b/includes/api/ApiSetPageLanguage.php
index 3f03c02..1a4a10b 100755
--- a/includes/api/ApiSetPageLanguage.php
+++ b/includes/api/ApiSetPageLanguage.php
@@ -84,7 +84,8 @@
$this,
$titleObj,
$params['lang'],
-   $params['tags'] ?: []
+   $params['tags'] ?: [],
+   $params['reason'] ?: ''
);
 
if ( !$status->isOK() ) {
@@ -121,6 +122,7 @@
),
ApiBase::PARAM_REQUIRED => true,
],
+   'reason' => null,
'tags' => [
ApiBase::PARAM_TYPE => 'tags',
ApiBase::PARAM_ISMULTI => true,
diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index 9915d39..1385097 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -1360,6 +1360,7 @@
"apihelp-setpagelanguage-param-title": "Title of the page whose 
language you wish to change. Cannot be used together with $1pageid.",
"apihelp-setpagelanguage-param-pageid": "Page ID of the page whose 
language you wish to change. Cannot be used together with $1title.",
"apihelp-setpagelanguage-param-lang": "Language code of the language to 
change the page to. Use default to reset the page to the wiki's 
default content language.",
+   "apihelp-setpagelanguage-param-reason": "Reason for the change.",
"apihelp-setpagelanguage-param-tags": "Change tags to apply to the log 
entry resulting from this action.",
"apihelp-setpagelanguage-example-language": "Change the language of 
Main Page to Basque.",
"apihelp-setpagelanguage-example-default": "Change the language of the 
page with ID 123 to the wiki's default content language.",
diff --git a/includes/api/i18n/qqq.json b/includes/api/i18n/qqq.json
index c6b14cd..cab2a3e 100644
--- a/includes/api/i18n/qqq.json
+++ b/includes/api/i18n/qqq.json
@@ -1268,6 +1268,7 @@
"apihelp-setpagelanguage-param-title": 
"{{doc-apihelp-param|setpagelanguage|title}}",
"apihelp-setpagelanguage-param-pageid": 
"{{doc-apihelp-param|setpagelanguage|pageid}}",
"apihelp-setpagelanguage-param-lang": 
"{{doc-apihelp-param|setpagelanguage|lang}}",
+   "apihelp-setpagelanguage-param-reason": 
"{{doc-apihelp-param|setpagelanguage|reason}}",
"apihelp-setpagelanguage-param-tags": 
"{{doc-apihelp-param|setpagelanguage|tags}}",
"apihelp-setpagelanguage-example-language": 
"{{doc-apihelp-example|setpagelanguage}}",
"apihelp-setpagelanguage-example-default": 
"{{doc-apihelp-example|setpagelanguage}}",
diff --git a/includes/specials/SpecialPageLanguage.php 
b/includes/specials/SpecialPageLanguage.php
index 8546a08..fa44dd9 100644
--- a/includes/specials/SpecialPageLanguage.php
+++ b/includes/specials/SpecialPageLanguage.php
@@ -89,6 +89,12 @@
'default' => $this->getConfig()->get( 'LanguageCode' ),
];
 
+   // Allow user to enter a comment explaining the change
+   $page['reason'] = [
+   'type' => 'text',
+   'label-message' => 'pagelang-reason'
+   ];
+
return $page;
}
 
@@ -132,7 +138,12 @@
// Url to redirect to after the operation
$this->goToUrl = $title->getFullURL();
 
-   return self::changePageLanguage( $this->getContext(), $title, 
$newLanguage );
+   return self::changePageLanguage(
+   $this->getContext(),
+   $title,
+   $newLanguage,
+   $data['reason'] ?: ''
+   );
}
 
/**
@@ -140,10 +151,11 @@
 * @param Title $title
 * @param string $newLanguage Language code
 * @param array $tags Change 

[MediaWiki-commits] [Gerrit] mediawiki...Foxway[master]: DO NOT MERGE (Testing the tests)

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

Change subject: DO NOT MERGE (Testing the tests)
..

DO NOT MERGE (Testing the tests)

Change-Id: I141980633be33a307dda7f64eaad1e15adc27f4f
---
M Foxway.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Foxway 
refs/changes/45/330745/1

diff --git a/Foxway.php b/Foxway.php
index d2eb733..facbbdb 100644
--- a/Foxway.php
+++ b/Foxway.php
@@ -36,7 +36,7 @@
 $wgExtensionMessagesFiles['FoxwayMagic'] = $dir . '/Foxway.i18n.magic.php';
 
 // Include the settings file.
-//require_once $dir . '/Settings.php';
+// require_once $dir . '/Settings.php';
 
 // Specify the function that will initialize the parser function.
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I141980633be33a307dda7f64eaad1e15adc27f4f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Foxway
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Migrate away from UtfNormal in core to external UtfNormal li...

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

Change subject: Migrate away from UtfNormal in core to external UtfNormal 
library
..

Migrate away from UtfNormal in core to external UtfNormal library

In MediaWiki version 1.25, the UtfNormal library was split into a separate 
wikimedia/utfnormal package.
This patch changes the code to reflect this change.

Bug: T153994
Change-Id: I9d46ba835726e7099aab39e032ab29a2a9f86e02
---
M classes/Hooks.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/classes/Hooks.php b/classes/Hooks.php
index 2598c21..18aebbc 100644
--- a/classes/Hooks.php
+++ b/classes/Hooks.php
@@ -1,6 +1,7 @@
 https://gerrit.wikimedia.org/r/330728
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Foxway[master]: Migrate away from UtfNormal in core to external UtfNormal li...

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

Change subject: Migrate away from UtfNormal in core to external UtfNormal 
library
..

Migrate away from UtfNormal in core to external UtfNormal library

In MediaWiki version 1.25, the UtfNormal library was split into a separate 
wikimedia/utfnormal package.
This patch changes the code to reflect this change.

Bug: T153994
Change-Id: I8371572b70ae95b227fb6d22119a4dc47b379044
---
M Foxway.body.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Foxway 
refs/changes/27/330727/1

diff --git a/Foxway.body.php b/Foxway.body.php
index 62f63c3..4f7879a 100644
--- a/Foxway.body.php
+++ b/Foxway.body.php
@@ -7,6 +7,9 @@
  * @author Pavel Astakhov 
  * @licence GNU General Public Licence 2.0 or later
  */
+
+use UtfNormal\Validator;
+
 class Foxway {
 
static $DebugLoops = false;
@@ -47,7 +50,7 @@
$return = implode($result);
 
self::$time += microtime(true) - self::$startTime;
-   return \UtfNormal::cleanUp($return);
+   return Validator::cleanUp($return);
}
 
public static function render($input, array $args, Parser $parser, 
PPFrame $frame) {
@@ -82,7 +85,7 @@
}
 
self::$time += microtime(true) - self::$startTime;
-   return \UtfNormal::cleanUp($return);
+   return Validator::cleanUp($return);
}
 
public static function isBanned(PPFrame $frame) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8371572b70ae95b227fb6d22119a4dc47b379044
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Foxway
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...ActiveAbstract[master]: Migrate away from UtfNormal in core to external UtfNormal li...

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

Change subject: Migrate away from UtfNormal in core to external UtfNormal 
library
..

Migrate away from UtfNormal in core to external UtfNormal library

In MediaWiki version 1.25, the UtfNormal library was split into a separate 
wikimedia/utfnormal package.
This patch changes the code to reflect this change.

Bug: T153994
Change-Id: Ideff34ca76fff35100d820ccad83e027c0864881
---
M AbstractFilter.php
1 file changed, 4 insertions(+), 2 deletions(-)


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

diff --git a/AbstractFilter.php b/AbstractFilter.php
index 78b2466..3782569 100644
--- a/AbstractFilter.php
+++ b/AbstractFilter.php
@@ -15,6 +15,8 @@
  *   --filter=abstract:variant=zh-cn
  */
 
+use UtfNormal\Validator;
+
 /**
  * Tosses away the MediaWiki XML and generates new output
  */
@@ -120,7 +122,7 @@
$extract = $this->extractStart( $stripped );
$clipped = substr( $extract, 0, 1024 ); // not too long pls
 
-   return UtfNormal::cleanUp( $clipped );
+   return Validator::cleanUp( $clipped );
}
 
/**
@@ -222,7 +224,7 @@
for ( $i = 1; $i < $secsCount; $i += 2 ) {
$inside = preg_replace( '/^=+\s*(.*?)\s*=+/', '$1', 
$secs[$i] );
$stripped = $this->stripMarkup( $inside ); // strip 
internal markup and 
-   $header = UtfNormal::cleanUp( $stripped );
+   $header = Validator::cleanUp( $stripped );
$anchor = $wgParser->guessSectionNameFromWikiText( 
$header );
$url = $this->title->getCanonicalUrl() . $anchor;
$headers[$header] = $url;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ideff34ca76fff35100d820ccad83e027c0864881
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ActiveAbstract
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...AntiSpoof[master]: Migrate away from UtfNormal in core to external UtfNormal li...

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

Change subject: Migrate away from UtfNormal in core to external UtfNormal 
library
..

Migrate away from UtfNormal in core to external UtfNormal library

In MediaWiki version 1.25, the UtfNormal library was split into a separate 
wikimedia/utfnormal package.
This patch changes the code to reflect this change.

Bug: T153994
Change-Id: I6d70d5fbb463ff6812421998fbfe26348f71c405
---
M AntiSpoof_body.php
1 file changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/AntiSpoof_body.php b/AntiSpoof_body.php
index 50b7706..6ac03c9 100644
--- a/AntiSpoof_body.php
+++ b/AntiSpoof_body.php
@@ -29,6 +29,8 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
 # USA
 
+use UtfNormal\Validator;
+
 class AntiSpoof {
# Define script tag codes for various Unicode codepoint ranges
# If it does not have a code here, it does not have a script assignment
@@ -341,7 +343,7 @@
}
 
# Perform Unicode _compatibility_ decomposition
-   $testName = UtfNormal::toNFKD( $testName );
+   $testName = Validator::toNFKD( $testName );
$testChars = self::stringToList( $testName );
 
# Be paranoid: check again, just in case Unicode normalization 
code changes...

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d70d5fbb463ff6812421998fbfe26348f71c405
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Follow up to I42e74ed3bcd0bfa9ec0c344ba67668210450c975

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

Change subject: Follow up to I42e74ed3bcd0bfa9ec0c344ba67668210450c975
..

Follow up to I42e74ed3bcd0bfa9ec0c344ba67668210450c975

* Make pagelang-unchanged-language-default message documentation more explicit
* Use same code when displaying pagelang-unchanged-language-default and 
pagelang-unchanged-language
* Use 'this action' instead of 'this API'

Change-Id: I4bb4e380e090e507a26ca24b5364d8cfc7a7de71
---
M includes/api/i18n/en.json
M includes/specials/SpecialPageLanguage.php
M languages/i18n/qqq.json
3 files changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/330686/1

diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index 4b6e932..79d0295 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -1354,7 +1354,7 @@
"apihelp-setnotificationtimestamp-example-allpages": "Reset the 
notification status for pages in the {{ns:user}} namespace.",
 
"apihelp-setpagelanguage-description": "Change the language of a page.",
-   "apihelp-setpagelanguage-description-disabled": "Changing the language 
of a page is not allowed on this wiki.\n\nEnable 
[[mw:Manual:$wgPageLanguageUseDB|$wgPageLanguageUseDB]] to use the 
API.",
+   "apihelp-setpagelanguage-description-disabled": "Changing the language 
of a page is not allowed on this wiki.\n\nEnable 
[[mw:Manual:$wgPageLanguageUseDB|$wgPageLanguageUseDB]] to use this 
action.",
"apihelp-setpagelanguage-param-title": "Title of the page whose 
language you wish to change. Cannot be used together with $1pageid.",
"apihelp-setpagelanguage-param-pageid": "Page ID of the page whose 
language you wish to change. Cannot be used together with $1title.",
"apihelp-setpagelanguage-param-lang": "Language code of the language to 
change the page to. Use default to reset the page to the wiki's 
default content language.",
diff --git a/includes/specials/SpecialPageLanguage.php 
b/includes/specials/SpecialPageLanguage.php
index 55ae692..8546a08 100644
--- a/includes/specials/SpecialPageLanguage.php
+++ b/includes/specials/SpecialPageLanguage.php
@@ -175,10 +175,13 @@
if ( $newLanguage === $oldLanguage ) {
// Check if old language does not exist
if ( !$oldLanguage ) {
-   return Status::newFatal(
-   'pagelang-unchanged-language-default',
-   wfEscapeWikiText( 
$title->getPrefixedText() )
-   );
+   return Status::newFatal( ApiMessage::create(
+   [
+   
'pagelang-unchanged-language-default',
+   wfEscapeWikiText( 
$title->getPrefixedText() )
+   ],
+   'pagelang-unchanged-language'
+   ) );
}
return Status::newFatal(
'pagelang-unchanged-language',
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 7763894..1939bbd 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -4243,7 +4243,7 @@
"pagelang-submit": "Submit button label for Special:PageLanguage 
form\n{{Identical|Submit}}",
"pagelang-nonexistent-page": "Error message shown when the page the 
user is trying to change the language on does not exist.\n\nParameters:\n* $1 - 
the title of the nonexistent page",
"pagelang-unchanged-language": "Error message shown when the language 
the user is trying to change the page to and the current language the page is 
in are the same.\n\nParameters:\n* $1 - the title of the target page\n* $2 - 
the current language of the page",
-   "pagelang-unchanged-language-default": "Error message shown when the 
language the user is trying to change the page to is already the wiki's default 
content language.\n\nParameters:\n* $1 - the title of the target page",
+   "pagelang-unchanged-language-default": "Error message shown when the 
language the user is trying to set a page to fall back to the wiki's default 
content language, but the page is already set to do so.\n\nParameters:\n* $1 - 
the title of the target page",
"pagelang-db-failed": "Error message shown when the database fails to 
update the language of the page",
"right-pagelang": "{{Doc-right|pagelang}}\nRight to change page 
language on Special:PageLanguage",
"action-pagelang": "{{Doc-action|pagelang}}",

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

Gerrit-MessageType: 

[MediaWiki-commits] [Gerrit] mediawiki...SemanticComments[master]: Replace deprecated Article::getContent() usage

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

Change subject: Replace deprecated Article::getContent() usage
..

Replace deprecated Article::getContent() usage

Bug: T151973
Change-Id: Ib875d7114190238b8e4aa4e03ceafa1de7d4fe5a
---
M specials/Comment/CE_Comment.php
M specials/Comment/CE_CommentAjaxAccess.php
2 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/specials/Comment/CE_Comment.php b/specials/Comment/CE_Comment.php
index 5ef2344..54d0c24 100644
--- a/specials/Comment/CE_Comment.php
+++ b/specials/Comment/CE_Comment.php
@@ -154,7 +154,7 @@
// update semantic data for the realted article
$title = Title::newFromText( $relatedArticle );
$article = new Article( $title );
-   $text = $article->getContent();
+   $text = ContentHandler::getContentText( 
$article->getPage()->getContent() );
$options = new ParserOptions;
$output = $wgParser->parse( $article->preSaveTransform( 
$text ), 
$article->mTitle, $options
diff --git a/specials/Comment/CE_CommentAjaxAccess.php 
b/specials/Comment/CE_CommentAjaxAccess.php
index f5e0e64..dde61e6 100644
--- a/specials/Comment/CE_CommentAjaxAccess.php
+++ b/specials/Comment/CE_CommentAjaxAccess.php
@@ -81,7 +81,7 @@
$title = Title::makeTitle( CE_COMMENT_NS, 
$title );
}
$article = new Article( $title );
-   $articleContent = $article->getContent();
+   $articleContent = ContentHandler::getContentText( 
$article->getPage()->getContent() );
$date = new Datetime( null, new DateTimeZone( 'UTC' ) );
$articleContent = preg_replace( 
'/\|CommentContent.*}}/',
'|CommentContent=' . $wgUser->getName() . ' ' .
@@ -120,7 +120,7 @@
$title = Title::makeTitle( CE_COMMENT_NS, 
$title );
}
$article = new Article( $title );
-   $articleContent = $article->getContent();
+   $articleContent = ContentHandler::getContentText( 
$article->getPage()->getContent() );
$articleDel = $article->doDelete( wfMessage( 
'ce_comment_delete_reason' )->text() );
$success = true;
} catch( Exception $e ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib875d7114190238b8e4aa4e03ceafa1de7d4fe5a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticComments
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...News[master]: Replace deprecated Article::getContent() usage

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

Change subject: Replace deprecated Article::getContent() usage
..

Replace deprecated Article::getContent() usage

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


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

diff --git a/NewsRenderer.php b/NewsRenderer.php
index e8da045..c52d039 100644
--- a/NewsRenderer.php
+++ b/NewsRenderer.php
@@ -523,13 +523,13 @@
 
if ( stripos($templatetext, '{{{content}}}')!==false || 
stripos($templatetext, '{{{head}}}')!==false ) {
$article = new Article( $title, 
$row->rc_this_oldid );
-   $t = $article->getContent();
+   $articleText = ContentHandler::getContentText( 
$article->getPage()->getContent() );
 
//TODO: expand variables & templates first, so 
cut-off applies to effective content,
//  and extension tags from templates are 
stripped properly
//  this doesn't work though: $t = 
$this->templateparser->preprocess( $t, $this->title, new ParserOptions() );
//TODO: avoid magic categories, 
interwiki-links, etc
-   $params['content'] = 
NewsRenderer::sanitizeWikiText( $t, $this->templateparser );
+   $params['content'] = 
NewsRenderer::sanitizeWikiText( $articleText, $this->templateparser );
 
if ( stripos($templatetext, 
'{{{head}}}')!==false ) {
$params['head'] = 
NewsRenderer::extractHead( $params['content'], $title );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Video[master]: Remove getContent() function from VideoPage.php

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

Change subject: Remove getContent() function from VideoPage.php
..

Remove getContent() function from VideoPage.php

Article::getContent() was deprecated in MediaWiki version 1.21.
The getContent() function called this deprecated method.
Since getContent() is unused, both are removed in this patch.

Bug: T151973
Change-Id: I1fdfdeb8284f63133b8a054dc8319f5ba50157b4
---
M VideoPage.php
1 file changed, 0 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Video 
refs/changes/27/330627/1

diff --git a/VideoPage.php b/VideoPage.php
index dfe4d47..92d3699 100644
--- a/VideoPage.php
+++ b/VideoPage.php
@@ -130,11 +130,6 @@
}
}
 
-   /** @todo FIXME: is this needed? If not, remove! */
-   function getContent() {
-   return Article::getContent();
-   }
-
/**
 * Get the HTML table that contains the code for embedding the current
 * video on a wiki page.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1fdfdeb8284f63133b8a054dc8319f5ba50157b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Video
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add api 'setPageLanguage' action for Special:PageLanguage

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

Change subject: Add api 'setPageLanguage' action for Special:PageLanguage
..

Add api 'setPageLanguage' action for Special:PageLanguage

Currently, a user who wants to set a page's language must use the 
Special:PageLanguage interface. However, this is not easy for bots and scripts 
to use. The addition of this API makes this process easier for everyone.

Bug: T74958
Change-Id: I42e74ed3bcd0bfa9ec0c344ba67668210450c975
---
M autoload.php
M includes/api/ApiMain.php
A includes/api/ApiSetPageLanguage.php
M includes/api/i18n/en.json
M includes/api/i18n/qqq.json
M includes/specials/SpecialPageLanguage.php
M languages/i18n/en.json
M languages/i18n/qqq.json
8 files changed, 195 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/40/330340/1

diff --git a/autoload.php b/autoload.php
index cdbdf1f..a38fca2 100644
--- a/autoload.php
+++ b/autoload.php
@@ -139,6 +139,7 @@
'ApiRsd' => __DIR__ . '/includes/api/ApiRsd.php',
'ApiSerializable' => __DIR__ . '/includes/api/ApiSerializable.php',
'ApiSetNotificationTimestamp' => __DIR__ . 
'/includes/api/ApiSetNotificationTimestamp.php',
+   'ApiSetPageLanguage' => __DIR__ . 
'/includes/api/ApiSetPageLanguage.php',
'ApiStashEdit' => __DIR__ . '/includes/api/ApiStashEdit.php',
'ApiTag' => __DIR__ . '/includes/api/ApiTag.php',
'ApiTokens' => __DIR__ . '/includes/api/ApiTokens.php',
diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index 4220fb8..52f1d95 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -106,6 +106,7 @@
'managetags' => 'ApiManageTags',
'tag' => 'ApiTag',
'mergehistory' => 'ApiMergeHistory',
+   'setpagelanguage' => 'ApiSetPageLanguage',
];
 
/**
diff --git a/includes/api/ApiSetPageLanguage.php 
b/includes/api/ApiSetPageLanguage.php
new file mode 100755
index 000..0d2def1
--- /dev/null
+++ b/includes/api/ApiSetPageLanguage.php
@@ -0,0 +1,141 @@
+"
+ *
+ * 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, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * API module that facilitates changing the language of a page. The API 
equivalent of SpecialPageLanguage.
+ * Requires API write mode to be enabled.
+ *
+ * @ingroup API
+ */
+class ApiSetPageLanguage extends ApiBase {
+   /**
+* Extracts the title and language from the request parameters and 
invokes
+* the static SpecialPageLanguage::changePageLanguage() function with 
these as arguments.
+* If the language change succeeds, the details of the article changed
+* and the reason for the language change are added to the result 
object.
+*/
+   public function execute() {
+   // Check if change language feature is enabled
+   global $wgPageLanguageuseDB;
+   if ( !$wgPageLanguageuseDB ) {
+   $this->dieWithError( 'apierror-pagelang-disabled' );
+   }
+
+   // Check if the user has permissions
+   $this->checkUserRightsAny( 'pagelang' );
+
+   $this->useTransactionalTimeLimit();
+
+   $params = $this->extractRequestParams();
+
+   $pageObj = $this->getTitleOrPageId( $params, 'fromdbmaster' );
+   if ( !$pageObj->exists() ) {
+   $this->dieWithError( 'apierror-missingtitle' );
+   }
+
+   $titleObj = $pageObj->getTitle();
+   $reason = $params['reason'];
+   $user = $this->getUser();
+
+   // Check that the user is allowed to edit the page
+   $this->checkTitleUserPermissions( $titleObj, 'edit' );
+
+   // If change tagging was requested, check that the user is 
allowed to tag,
+   // and the tags are valid
+   if ( count( $params['tags'] ) ) {
+   $tagStatus = ChangeTags::canAddTagsAccompanyingChange( 
$params['tags'], $user );
+   if ( !$tagStatus->isOK() ) {
+   $this->dieStatus( 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Replace assertRaises with asserRaisesRegex in family_tests.py

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

Change subject: Replace assertRaises with asserRaisesRegex in family_tests.py
..

Replace assertRaises with asserRaisesRegex in family_tests.py

assertRaises is not as good of a test as asserRaisesRegex. The latter has an 
extra parameter to match the exception message, allowing more more precision 
when checking an error.

Bug: T154281
Change-Id: Idb030c163f48f349f0adabd5c27dd90dac0d5b4b
---
M tests/family_tests.py
1 file changed, 48 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/99/330099/1

diff --git a/tests/family_tests.py b/tests/family_tests.py
index 41ab51d..c8c9b2f 100644
--- a/tests/family_tests.py
+++ b/tests/family_tests.py
@@ -28,6 +28,10 @@
 
 """Test cases for Family methods."""
 
+UNKNOWNFAMILY_RE = 'Family unknown does not exist'
+FAMILY_TYPEERROR_RE = 'Family.obsolete not updatable; ' \
+'use Family.interwiki_removals and Family.interwiki_replacements'
+FROZENSET_TYPEERROR_RE = '\'frozenset\' object does not support item 
assignment'
 net = False
 
 def test_family_load_valid(self):
@@ -58,7 +62,11 @@
 
 def test_family_load_invalid(self):
 """Test that an invalid family raised UnknownFamily exception."""
-self.assertRaises(UnknownFamily, Family.load, 'unknown')
+self.assertRaisesRegex(
+UnknownFamily,
+self.UNKNOWNFAMILY_RE,
+Family.load,
+'unknown')
 
 def test_eq_different_families_by_name(self):
 """Test that two Family with same name are equal."""
@@ -96,7 +104,11 @@
 """Test that Family and string with different name are not equal."""
 family = Family.load('wikipedia')
 other = 'unknown'
-self.assertRaises(UnknownFamily, family.__eq__, other)
+self.assertRaisesRegex(
+UnknownFamily,
+self.UNKNOWNFAMILY_RE,
+family.__eq__,
+other)
 
 def test_get_obsolete_wp(self):
 """Test three types of obsolete codes."""
@@ -132,14 +144,27 @@
 def test_obsolete_readonly(self):
 """Test obsolete result not updatable."""
 family = Family.load('test')
-self.assertRaises(TypeError, family.obsolete.update, {})
-self.assertRaises(TypeError, family.obsolete.__setitem__, 'a', 'b')
+self.assertRaisesRegex(
+TypeError,
+self.FAMILY_TYPEERROR_RE,
+family.obsolete.update,
+{})
+self.assertRaisesRegex(
+TypeError,
+self.FAMILY_TYPEERROR_RE,
+family.obsolete.__setitem__,
+'a',
+'b')
 
 def test_WikimediaFamily_obsolete_readonly(self):
 """Test WikimediaFamily obsolete is readonly."""
 family = Family.load('test')
-self.assertRaises(TypeError, family.__setattr__, 'obsolete',
-  {'a': 'b', 'c': None})
+self.assertRaisesRegex(
+TypeError,
+self.FROZENSET_TYPEERROR_RE,
+family.__setattr__,
+'obsolete',
+{'a': 'b', 'c': None})
 
 
 class TestFamilyUrlRegex(PatchingTestCase):
@@ -185,8 +210,11 @@
 self.assertEqual(f.from_url('//vo.wikipedia.org/wiki/$1'), 'vo')
 
 # Text after $1 is not allowed
-self.assertRaises(ValueError, f.from_url,
-  '//vo.wikipedia.org/wiki/$1/foo')
+self.assertRaisesRegex(
+ValueError,
+'Text after the \$1 placeholder is not supported \(T111513\)',
+f.from_url,
+'//vo.wikipedia.org/wiki/$1/foo')
 
 # the IWM may contain the wrong protocol, but it's only used to
 # determine a site so using HTTP or HTTPS is not an issue
@@ -225,6 +253,7 @@
 
 """Test cases for old site.Family method."""
 
+UNKNOWNFAMILY_RE = 'Family unknown does not exist'
 net = False
 
 def test_old_site_family_function(self):
@@ -251,9 +280,17 @@
 # As assertRaises calls the method, unittest is the module
 # invoking the method instead of this test module.
 self._do_test_warning_filename = False
-self.assertRaises(UnknownFamily, pywikibot.site.Family, 'unknown',
-  fatal=False)
-self.assertRaises(UnknownFamily, pywikibot.site.Family, 'unknown')
+self.assertRaisesRegex(
+UnknownFamily,
+self.UNKNOWNFAMILY_RE,
+pywikibot.site.Family,
+'unknown',
+fatal=False)
+self.assertRaisesRegex(
+UnknownFamily,
+self.UNKNOWNFAMILY_RE,
+pywikibot.site.Family,
+'unknown')
 self.assertDeprecationParts('pywikibot.site.Family',
 

[MediaWiki-commits] [Gerrit] mediawiki...LinkFilter[master]: Replace deprecated Article::doEdit()

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

Change subject: Replace deprecated Article::doEdit()
..

Replace deprecated Article::doEdit()

Article::doEdit() has been deprecated since MW 1.21. This patch replaces the 
"Article" class with "WikiPage".

Bug: T151973
Change-Id: Ic0d2e01724efa65af2f00b82a058974a98316724
---
M LinkClass.php
1 file changed, 7 insertions(+), 4 deletions(-)


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

diff --git a/LinkClass.php b/LinkClass.php
index c0df7eb..8fa0c2f 100644
--- a/LinkClass.php
+++ b/LinkClass.php
@@ -126,9 +126,12 @@
 
// Create the wiki page for the newly-approved link
$linkTitle = Title::makeTitleSafe( NS_LINK, $link['title'] );
-   $article = new Article( $linkTitle );
-   $article->doEdit( $link['url'], wfMessage( 
'linkfilter-edit-summary' )->inContentLanguage()->text() );
-   $newPageId = $article->getID();
+   $page = WikiPage::factory( $linkTitle );
+   $page->doEdit(
+   $link['url'],
+   wfMessage( 'linkfilter-edit-summary' 
)->inContentLanguage()->text()
+   );
+   $newPageID = $page->getID();
 
// Tie link record to wiki page
$dbw = wfGetDB( DB_MASTER );
@@ -140,7 +143,7 @@
$dbw->update(
'link',
/* SET */array(
-   'link_page_id' => intval( $newPageId ),
+   'link_page_id' => intval( $newPageID ),
'link_approved_date' => $date
),
/* WHERE */array( 'link_id' => intval( $id ) ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0d2e01724efa65af2f00b82a058974a98316724
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LinkFilter
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...FanBoxes[master]: Replace deprecated Article::doEdit()

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

Change subject: Replace deprecated Article::doEdit()
..

Replace deprecated Article::doEdit()

Article::doEdit() has been deprecated since MW 1.21. This patch replaces the 
"Article" class with "WikiPage" and "doEdit" with "doEditContent".

Bug: T151973
Change-Id: Iba294e14ba00c836fe5451654a7a3e15028a6c8e
---
M FanBoxClass.php
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FanBoxes 
refs/changes/88/329788/1

diff --git a/FanBoxClass.php b/FanBoxClass.php
index c03c898..215ffe5 100644
--- a/FanBoxClass.php
+++ b/FanBoxClass.php
@@ -88,9 +88,9 @@
trim( $category ) . "]]\n";
}
}
-   $article = new Article( $this->title );
+   $page = WikiPage::factory( $this->title );
 
-   $article_content = $this->buildWikiText() . "\n\n" .
+   $pageContent = $this->buildWikiText() . "\n\n" .
$this->getBaseCategories() . "\n" . $categories_wiki .
"\n__NOEDITSECTION__";
 
@@ -100,7 +100,7 @@
$descTitle->purgeSquid();
} else {
// New fantag; create the description page.
-   $article->doEdit( $this->buildWikiText() . "\n\n" . 
$article_content, $desc );
+   $page->doEditContent( $this->buildWikiText() . "\n\n" . 
$pageContent, $desc );
}
 
# Test to see if the row exists using INSERT IGNORE
@@ -215,13 +215,13 @@
':' . trim( $category ) . "]]\n";
}
}
-   $article = new Article( $this->title );
+   $page = WikiPage::factory( $this->title );
 
-   $article_content = $this->buildWikiText() . "\n" .
+   $pageContent = $this->buildWikiText() . "\n" .
$this->getBaseCategories() . "\n" . $categories_wiki .
"\n__NOEDITSECTION__";
 
-   $article->doEdit( $article_content, wfMessage( 
'fanbox-summary-update' )->inContentLanguage()->parse() );
+   $page->doEditContent( $pageContent, wfMessage( 
'fanbox-summary-update' )->inContentLanguage()->parse() );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba294e14ba00c836fe5451654a7a3e15028a6c8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FanBoxes
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...DynamicPageList[master]: Replace deprecated Article::doEdit()

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

Change subject: Replace deprecated Article::doEdit()
..

Replace deprecated Article::doEdit()

Article::doEdit() has been deprecated since MW 1.21. This patch replaces the 
"Article" class with "WikiPage" and "doEdit" with "doEditContent".

Bug: T151973
Change-Id: If84b4c43bc69f12b9cb345558c611d4ebff795b3
---
M DPL.php
M DPLSetup.php
2 files changed, 14 insertions(+), 5 deletions(-)


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

diff --git a/DPL.php b/DPL.php
index ff1b352..1b9357b 100644
--- a/DPL.php
+++ b/DPL.php
@@ -1068,9 +1068,14 @@
$titleX = Title::newFromText( $title );
$permissionErrors = $titleX->getUserPermissionsErrors( 'edit', 
$wgUser );
if ( count( $permissionErrors ) == 0 ) {
-   $articleX = new Article( $titleX );
-   $articleX->doEdit( $text, $summary, EDIT_UPDATE | 
EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY );
-   $wgOut->redirect( $titleX->getFullURL( 
$articleX->isRedirect() ? 'redirect=no' : '' ) );
+   $pageX = WikiPage::factory( $titleX );
+   $pageXContent = ContentHandler::makeContent( $text, 
$pageX->getTitle() );
+   $pageX->doEditContent(
+   $pageXContent,
+   $summary,
+   EDIT_UPDATE | EDIT_DEFER_UPDATES | 
EDIT_AUTOSUMMARY
+   );
+   $wgOut->redirect( $titleX->getFullURL( 
$pageX->isRedirect() ? 'redirect=no' : '' ) );
return '';
} else {
$wgOut->showPermissionsErrorPage( $permissionErrors );
diff --git a/DPLSetup.php b/DPLSetup.php
index 8bbe0a1..e7c6cf7 100644
--- a/DPLSetup.php
+++ b/DPLSetup.php
@@ -1232,11 +1232,15 @@
$title = Title::newFromText( 'Template:Extension DPL' );
global $wgUser;
if ( !$title->exists() && $wgUser->isAllowed( 'edit' ) 
) {
-   $article = new Article( $title );
-   $article->doEdit(
+   $page = WikiPage::factory( $title );
+   $pageContent = ContentHandler::makeContent(
"This page was automatically 
created. It serves as an anchor page for " .
"all 
'''[[Special:WhatLinksHere/Template:Extension_DPL|invocations]]''' " .
"of 
[http://mediawiki.org/wiki/Extension:DynamicPageList Extension:DynamicPageList 
(DPL)].",
+   $page->getTitle()
+   );
+   $page->doEdit(
+   $pageContent
$title,
EDIT_NEW | EDIT_FORCE_BOT
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If84b4c43bc69f12b9cb345558c611d4ebff795b3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DynamicPageList
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlogPage[master]: Replace deprecated Article::doEdit()

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

Change subject: Replace deprecated Article::doEdit()
..

Replace deprecated Article::doEdit()

Article::doEdit() has been deprecated since MW 1.21. This patch replaces the 
"Article" class with "WikiPage" and "doEdit" with "doEditContent".

Bug: T151973
Change-Id: I0e7b6006e6ce7d8a372e2ca09f31a87e1f8c75db
---
M SpecialCreateBlogPost.php
1 file changed, 9 insertions(+), 5 deletions(-)


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

diff --git a/SpecialCreateBlogPost.php b/SpecialCreateBlogPost.php
index d179011..7f53905 100644
--- a/SpecialCreateBlogPost.php
+++ b/SpecialCreateBlogPost.php
@@ -101,8 +101,8 @@
$today = $wgContLang->date( wfTimestampNow() );
 
// Create the blog page if it doesn't already exist
-   $article = new Article( $title, 0 );
-   if ( $article->exists() ) {
+   $page = WikiPage::factory( $title );
+   if ( $page->exists() ) {
$out->setPageTitle( $this->msg( 
'errorpagetitle' ) );
$out->addWikiMsg( 
'blog-create-error-page-exists' );
$out->addReturnTo( $this->getPageTitle() );
@@ -139,7 +139,7 @@
$wikitextCategories = implode( "\n", 
$categories );
 
// Perform the edit
-   $article->doEdit(
+   $pageContent = ContentHandler::makeContent(
// Instead of , Wikia had 
Template:Blog Top over
// here and Template:Blog Bottom at the 
bottom, where we
// have the comments tag right now
@@ -147,10 +147,14 @@
$request->getVal( 'pageBody' ) 
. "\n\n" .
'' . "\n\n" . 
$wikitextCategories .
"\n__NOEDITSECTION__",
+   $page->getTitle()
+   );
+   $page->doEditContent(
+   $pageContent,
$this->msg( 'blog-create-summary' 
)->inContentLanguage()->text()
);
 
-   $articleId = $article->getID();
+   $pageID = $page->getID();
// Add a vote for the page
// This was originally in its own global 
function,
// wfFinishCreateBlog and after that in the 
BlogHooks class but
@@ -160,7 +164,7 @@
// Using OutputPageBeforeHTML hook, which, 
according to its
// manual page, runs on *every* page view was 
such a stupid
// idea IMHO.
-   $vote = new Vote( $articleId );
+   $vote = new Vote( $pageID );
$vote->insert( 1 );
 
$stats = new UserStatsTrack( $user->getID(), 
$user->getName() );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Thanks[master]: Replaced thanks-ltr/rtl (secondary) icons with larger thanks...

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

Change subject: Replaced thanks-ltr/rtl (secondary) icons with larger 
thanks-green-ltr/rtl (main) icons
..

Replaced thanks-ltr/rtl (secondary) icons with larger thanks-green-ltr/rtl 
(main) icons

Bug: T149352
Change-Id: Ic23db00a0a92b5cca6444f729a35d9da3d19fe0b
---
M Thanks.hooks.php
A thanks-green-ltr.svg
A thanks-green-rtl.svg
D thanks-ltr.svg
D thanks-rtl.svg
5 files changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Thanks 
refs/changes/29/329729/1

diff --git a/Thanks.hooks.php b/Thanks.hooks.php
index 7f43328..4067dc5 100644
--- a/Thanks.hooks.php
+++ b/Thanks.hooks.php
@@ -202,8 +202,8 @@
 
$icons['thanks'] = [
'path' => [
-   'ltr' => 'Thanks/thanks-ltr.svg',
-   'rtl' => 'Thanks/thanks-rtl.svg'
+   'ltr' => 'Thanks/thanks-green-ltr.svg',
+   'rtl' => 'Thanks/thanks-green-rtl.svg'
]
];
 
diff --git a/thanks-green-ltr.svg b/thanks-green-ltr.svg
new file mode 100644
index 000..1286511
--- /dev/null
+++ b/thanks-green-ltr.svg
@@ -0,0 +1,4 @@
+
+http://www.w3.org/2000/svg; width="30" height="30" viewBox="0 0 30 
30">
+
+
\ No newline at end of file
diff --git a/thanks-green-rtl.svg b/thanks-green-rtl.svg
new file mode 100644
index 000..f81b183
--- /dev/null
+++ b/thanks-green-rtl.svg
@@ -0,0 +1,4 @@
+
+http://www.w3.org/2000/svg; width="30" height="30" viewBox="0 0 30 
30">
+
+
\ No newline at end of file
diff --git a/thanks-ltr.svg b/thanks-ltr.svg
deleted file mode 100644
index b58974c..000
--- a/thanks-ltr.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-http://www.w3.org/2000/svg; width="24" height="24" viewBox="0 0 24 
24">
-
-
diff --git a/thanks-rtl.svg b/thanks-rtl.svg
deleted file mode 100644
index 7ef9ec2..000
--- a/thanks-rtl.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-http://www.w3.org/2000/svg; width="24" height="24" viewBox="0 0 24 
24">
-
-

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic23db00a0a92b5cca6444f729a35d9da3d19fe0b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Thanks
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add a 'ChangeUserGroups' hook in Special:Userrights

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

Change subject: Add a 'ChangeUserGroups' hook in Special:Userrights
..

Add a 'ChangeUserGroups' hook in Special:Userrights

Currently, there is no hook that runs before a user's groups are changed. 
Adding a hook here will allow for action before the groups are changed.

Bug: T49338
Change-Id: I87dbb6a8eb897f4a40215d33d1a0b24af7efa871
---
M docs/hooks.txt
M includes/specials/SpecialUserrights.php
2 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/329727/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index b6d37e0..bc88e80 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -1079,6 +1079,12 @@
 $rc: RecentChange being tagged when the tagging accompanies the action or null
 $user: User who performed the tagging when the tagging is subsequent to the 
action or null
 
+'ChangeUserGroups': Called before user groups are changed.
+$user: The User whose groups will be changed
+$added: The groups that will be added
+$removed: The groups that will be removed
+$performer: The User who will perform the change
+
 'Collation::factory': Called if $wgCategoryCollation is an unknown collation.
 $collationName: Name of the collation in question
 &$collationObject: Null. Replace with a subclass of the Collation class that
diff --git a/includes/specials/SpecialUserrights.php 
b/includes/specials/SpecialUserrights.php
index df98f33..99e93ac 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -250,6 +250,8 @@
$groups )
);
 
+   Hooks::run( 'ChangeUserGroups', [ $user, $add, $remove, 
$this->getUser() ] );
+
$oldGroups = $user->getGroups();
$newGroups = $oldGroups;
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add 'UnblockUser' and 'UnblockUserComplete' hooks to Special...

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

Change subject: Add 'UnblockUser' and 'UnblockUserComplete' hooks to 
Special:Unblock
..

Add 'UnblockUser' and 'UnblockUserComplete' hooks to Special:Unblock

Currently, there are two hooks ('BlockIP' and 'BlockIPComplete') that run when 
a user or IP is blocked in Special:Block, but no similar hooks when a user is 
unblocked in Special:Unblock. Adding these two hooks allows an extension to add 
and remove criteria about a user/IP unblock before it occurs and for possible 
action after an unblock is completed.

Bug: T50546
Change-Id: I9d9888dc5f1bb6a8bc62e90e6a423bf56b05173b
---
M docs/hooks.txt
M includes/specials/SpecialUnblock.php
2 files changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/329725/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index b165285..b6d37e0 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3379,6 +3379,15 @@
 $title: Title object to purge
 &$urls: An array of URLs to purge from the caches, to be manipulated.
 
+'UnblockUser': Before an IP address or user is unblocked.
+&$block: The Block object about to be saved
+&$user: The user performing the unblock (not the one being unblocked)
+&$reason: If the hook is aborted, the error message to be returned in an array
+
+'UnblockUserComplete': After an IP address or user has been unblocked.
+$block: The Block object that was saved
+$user: The user who performed the unblock (not the one being unblocked)
+
 'UndeleteForm::showHistory': Called in UndeleteForm::showHistory, after a
 PageArchive object has been created but before any further processing is done.
 &$archive: PageArchive object
diff --git a/includes/specials/SpecialUnblock.php 
b/includes/specials/SpecialUnblock.php
index 4e683f6..0d42e3f 100644
--- a/includes/specials/SpecialUnblock.php
+++ b/includes/specials/SpecialUnblock.php
@@ -209,11 +209,18 @@
return [ 'unblock-hideuser' ];
}
 
+   $reason = [ 'hookaborted' ];
+   if ( !Hooks::run( 'UnblockUser', [ &$block, &$performer, 
&$reason ] ) ) {
+   return $reason;
+   }
+
# Delete block
if ( !$block->delete() ) {
return [ [ 'ipb_cant_unblock', htmlspecialchars( 
$block->getTarget() ) ] ];
}
 
+   Hooks::run( 'UnblockUserComplete', [ $block, $performer ] );
+
# Unset _deleted fields as needed
if ( $block->mHideName ) {
# Something is deeply FUBAR if this is not a User 
object, but who knows?

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Clean up a few things in the Newsletter extension

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

Change subject: Clean up a few things in the Newsletter extension
..

Clean up a few things in the Newsletter extension

* Add and pass a reason parameter in the doUpdate() function in 
NewsletterDeletionUpdate class
* Rename hint from IDatabase to more accurate Database in NewsletterTablePager
* Uppercase ID in $filterForm->setSubmitId() in SpecialNewsletters

Bug: T153096
Change-Id: I1e8cb528b1edd94deb41d973982f63ce7ec8c2ed
---
M i18n/en.json
M i18n/qqq.json
M includes/content/NewsletterDeletionUpdate.php
M includes/specials/SpecialNewsletters.php
M includes/specials/pagers/NewsletterTablePager.php
5 files changed, 7 insertions(+), 3 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index 254874c..d738e4b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -71,6 +71,7 @@
"newsletter-manage-summary": "Summary of the change:",
"newsletter-delete": "Delete newsletter",
"newsletter-delete-failure": "\"$1\" newsletter could not be deleted. 
Please try again.",
+   "newsletter-delete-log": "Newsletter \"$1\" has been deleted.",
"newsletter-subscribe": "Newsletter subscription management",
"newsletter-subscribe-text": "This interface allows you to subscribe to 
\"$1\" newsletter. If you subscribe, you will receive notifications when new 
issues of this newsletter are announced.",
"newsletter-do-subscribe": "Subscribe to this newsletter",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 368e9b4..20b6adc 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -78,6 +78,7 @@
"newsletter-manage-summary": "Edit summary for updating fields in 
Special:Newsletter's manage form",
"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-delete-log": "Default message passed to the logentry as a 
comment when a newsletter is deleted in 
NewsletterDeletionUpdate\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}}",
"newsletter-subscribe-text": "Introductory message shown on 
Special:Newsletter//subscribe if the current user is not subscribed to the 
newsletter.\n\nParameters:\n* $1 - Name of the newsletter for the specified id",
"newsletter-do-subscribe": "Label for button shown on 
Special:Newsletter//subscribe. Adds the user as a subscriber to the 
newsletter when clicked on.",
diff --git a/includes/content/NewsletterDeletionUpdate.php 
b/includes/content/NewsletterDeletionUpdate.php
index 6637d4b..69a3042 100644
--- a/includes/content/NewsletterDeletionUpdate.php
+++ b/includes/content/NewsletterDeletionUpdate.php
@@ -14,8 +14,10 @@
public function __construct( $newsletterName ) {
$this->newsletter = Newsletter::newFromName( $newsletterName );
}
+
public function doUpdate() {
+   $reason = wfMessage( 'newsletter-delete-log', 
$this->newsletter->getName() )->text();
$store = NewsletterStore::getDefaultInstance();
-   $store->deleteNewsletter( $this->newsletter );
+   $store->deleteNewsletter( $this->newsletter, $reason );
}
 }
\ No newline at end of file
diff --git a/includes/specials/SpecialNewsletters.php 
b/includes/specials/SpecialNewsletters.php
index 27b3b91..dc69b2d 100644
--- a/includes/specials/SpecialNewsletters.php
+++ b/includes/specials/SpecialNewsletters.php
@@ -51,7 +51,7 @@
$this->getContext()
);
$filterForm->setId( 'mw-newsletter-filter-form' );
-   $filterForm->setSubmitId( 'mw-newsletter-filter-submit' 
);
+   $filterForm->setSubmitID( 'mw-newsletter-filter-submit' 
);
$filterForm->setMethod( 'get' );
// Note that submit button is hidden for users with JS 
enabled in
// as changing the dropdown menu's option updates the 
page for them
diff --git a/includes/specials/pagers/NewsletterTablePager.php 
b/includes/specials/pagers/NewsletterTablePager.php
index 44a9aa9..f704b92 100644
--- a/includes/specials/pagers/NewsletterTablePager.php
+++ b/includes/specials/pagers/NewsletterTablePager.php
@@ -20,7 +20,7 @@
 */
private $option;
 
-   public function __construct( IContextSource $context = null, IDatabase 
$readDb = null ) {
+   

[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Replace deprecated attribute "width" with CSS "width" property

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

Change subject: Replace deprecated attribute "width" with CSS "width" property
..

Replace deprecated attribute "width" with CSS "width" property

The width attribute is deprecated in HTML5. It should use the CSS width 
property instead. For example, width='100%' should be replaced with 
style="width: 100%;"

Bug: T42211
Change-Id: I34f7819b0615e951c0f433cfbbaff5bcc32784b0
---
M frontend/FlaggablePageView.php
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs 
refs/changes/01/329701/1

diff --git a/frontend/FlaggablePageView.php b/frontend/FlaggablePageView.php
index 64941ec..670bfe6 100755
--- a/frontend/FlaggablePageView.php
+++ b/frontend/FlaggablePageView.php
@@ -828,15 +828,15 @@
$multiNotice . "";
}
return
-   "" .
+   "" .
"" .
"" .
"" .
"" .
"" .
-   "" .
+   "" .
$leftStatus . "" .
-   "" .
+   "" .
$rightStatus . "" .
"" .
$multiNotice .
@@ -1612,13 +1612,13 @@
if ( $oldRev && $newRev ) {
list( $msg, $class ) = self::getDiffRevMsgAndClass( 
$oldRev, $srev );
$table .= "";
-   $table .= "";
+   $table .= "";
// @todo i18n FIXME: Hard coded brackets
$table .= "[" .
wfMessage( $msg )->escaped() . "]";
 
list( $msg, $class ) = self::getDiffRevMsgAndClass( 
$newRev, $srev );
-   $table .= "";
+   $table .= "";
// @todo i18n FIXME: Hard coded brackets
$table .= "[" .
wfMessage( $msg )->escaped() . "]";

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34f7819b0615e951c0f433cfbbaff5bcc32784b0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add tags support to the following API modules

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

Change subject: Add tags support to the following API modules
..

Add tags support to the following API modules

* imagerotate
* revisiondelete
* tag

Bug: T97720
Change-Id: I11418d22ee780944e92d82e32b271b8276c396bf
---
M includes/api/ApiImageRotate.php
M includes/api/ApiRevisionDelete.php
M includes/api/ApiTag.php
M includes/api/i18n/en.json
M includes/api/i18n/qqq.json
M includes/revisiondelete/RevDelList.php
6 files changed, 55 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/53/329653/1

diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php
index 72fb16d..92ac745 100644
--- a/includes/api/ApiImageRotate.php
+++ b/includes/api/ApiImageRotate.php
@@ -42,6 +42,14 @@
'invalidTitles', 'special', 'missingIds', 
'missingRevIds', 'interwikiTitles',
] );
 
+   // Check if user can add tags
+   if ( count( $params['tags'] ) ) {
+   $ableToTag = ChangeTags::canAddTagsAccompanyingChange( 
$params['tags'], $this->getUser() );
+   if ( !$ableToTag->isOK() ) {
+   $this->dieStatus( $ableToTag );
+   }
+   }
+
foreach ( $pageSet->getTitles() as $title ) {
$r = [];
$r['id'] = $title->getArticleID();
@@ -105,7 +113,7 @@
'rotate-comment'
)->numParams( $rotation 
)->inContentLanguage()->text();
$status = $file->upload( $dstPath,
-   $comment, $comment, 0, false, false, 
$this->getUser() );
+   $comment, $comment, 0, false, false, 
$this->getUser(), $params['tags'] ?: [] );
if ( $status->isGood() ) {
$r['result'] = 'Success';
} else {
@@ -157,6 +165,10 @@
'continue' => [
ApiBase::PARAM_HELP_MSG => 
'api-help-param-continue',
],
+   'tags' => [
+   ApiBase::PARAM_TYPE => 'tags',
+   ApiBase::PARAM_ISMULTI => true,
+   ],
];
if ( $flags ) {
$result += $this->getPageSet()->getFinalParams( $flags 
);
diff --git a/includes/api/ApiRevisionDelete.php 
b/includes/api/ApiRevisionDelete.php
index 763aef5..1748eb9 100644
--- a/includes/api/ApiRevisionDelete.php
+++ b/includes/api/ApiRevisionDelete.php
@@ -46,6 +46,14 @@
$this->dieWithError( [ 'apierror-paramempty', 'ids' ], 
'paramempty_ids' );
}
 
+   // Check if user can add tags
+   if ( count( $params['tags'] ) ) {
+   $ableToTag = ChangeTags::canAddTagsAccompanyingChange( 
$params['tags'], $user );
+   if ( !$ableToTag->isOK() ) {
+   $this->dieStatus( $ableToTag );
+   }
+   }
+
$hide = $params['hide'] ?: [];
$show = $params['show'] ?: [];
if ( array_intersect( $hide, $show ) ) {
@@ -91,7 +99,7 @@
$params['type'], $this->getContext(), $targetObj, 
$params['ids']
);
$status = $list->setVisibility(
-   [ 'value' => $bitfield, 'comment' => $params['reason'], 
'perItemStatus' => true ]
+   [ 'value' => $bitfield, 'comment' => $params['reason'], 
'perItemStatus' => true, 'tags' => $params['tags'] ]
);
 
$result = $this->getResult();
@@ -165,6 +173,10 @@
ApiBase::PARAM_DFLT => 'nochange',
],
'reason' => null,
+   'tags' => [
+   ApiBase::PARAM_TYPE => 'tags',
+   ApiBase::PARAM_ISMULTI => true,
+   ],
];
}
 
diff --git a/includes/api/ApiTag.php b/includes/api/ApiTag.php
index b142900..7470ff3 100644
--- a/includes/api/ApiTag.php
+++ b/includes/api/ApiTag.php
@@ -36,6 +36,14 @@
$this->dieBlocked( $user->getBlock() );
}
 
+   // Check if user can add tags
+   if ( count( $params['tags'] ) ) {
+   $ableToTag = ChangeTags::canAddTagsAccompanyingChange( 
$params['tags'], $user );
+   if ( !$ableToTag->isOk() ) {
+   $this->dieStatus( $ableToTag );
+   

[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Remove unnecessary doc for doLinkCacheQuery and fix a small ...

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

Change subject: Remove unnecessary doc for doLinkCacheQuery and fix a small typo
..

Remove unnecessary doc for doLinkCacheQuery and fix a small typo

* It doesn't return anything

Bug: T154233
Change-Id: Iab4262903dd3e22e3ffbd00ca6575ecf6d26b665
---
M includes/Echo/EchoNewsletterUserLocator.php
M includes/content/NewsletterContent.php
2 files changed, 1 insertion(+), 3 deletions(-)


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

diff --git a/includes/Echo/EchoNewsletterUserLocator.php 
b/includes/Echo/EchoNewsletterUserLocator.php
index 3e7b814..b70281d 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 beend 
deleted/invalid
+* @return User[]|array empty if the newsletter has been deleted/invalid
 */
public static function locateNewsletterSubscribedUsers( EchoEvent 
$event ) {
$extra = $event->getExtra();
diff --git a/includes/content/NewsletterContent.php 
b/includes/content/NewsletterContent.php
index 10788a2..0f2bb85 100644
--- a/includes/content/NewsletterContent.php
+++ b/includes/content/NewsletterContent.php
@@ -307,8 +307,6 @@
 * or not and add them to LinkCache
 *
 * @param Iterator $users
-*
-* @return string
 */
private function doLinkCacheQuery( Iterator $users ) {
$batch = new LinkBatch();

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Make Echo formatter point to Newsletter:NewsletterName

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

Change subject: Make Echo formatter point to Newsletter:NewsletterName
..

Make Echo formatter point to Newsletter:NewsletterName

* After migrating to content handler, newsletters urls point to 
Newsletter:NewsletterName instead of Special:Newsletter/id

Bug: T154244
Change-Id: Ib1eba8445e3af0a4f25792d858d6de8aea03865e
---
M includes/Echo/BaseNewsletterPresentationModel.php
M includes/Echo/EchoNewsletterPresentationModel.php
M includes/Echo/EchoNewsletterPublisherPresentationModel.php
M includes/Echo/EchoNewsletterSubscribedPresentationModel.php
M includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php
5 files changed, 6 insertions(+), 6 deletions(-)


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

diff --git a/includes/Echo/BaseNewsletterPresentationModel.php 
b/includes/Echo/BaseNewsletterPresentationModel.php
index 5c85942..a1a4be4 100644
--- a/includes/Echo/BaseNewsletterPresentationModel.php
+++ b/includes/Echo/BaseNewsletterPresentationModel.php
@@ -14,7 +14,7 @@
return $this->event->getExtraParam( 'newsletter-name' );
}
 
-   protected function getSpecialNewsletterUrl(){
-   return SpecialPage::getTitleFor( 'Newsletter', 
$this->getNewsletterId() )->getFullURL();
+   protected function getNewsletterUrl(){
+   return Title::makeTitleSafe( NS_NEWSLETTER, 
$this->getNewsletterName() )->getFullURL() );
}
 }
diff --git a/includes/Echo/EchoNewsletterPresentationModel.php 
b/includes/Echo/EchoNewsletterPresentationModel.php
index abb40fd..2a586c5 100644
--- a/includes/Echo/EchoNewsletterPresentationModel.php
+++ b/includes/Echo/EchoNewsletterPresentationModel.php
@@ -24,7 +24,7 @@
public function getSecondaryLinks() {
return array(
array(
-   'url' => $this->getSpecialNewsletterUrl(),
+   'url' => $this->getNewsletterUrl(),
'label' => $this->msg( 
'newsletter-notification-link-text-view-newsletter' )
),
);
diff --git a/includes/Echo/EchoNewsletterPublisherPresentationModel.php 
b/includes/Echo/EchoNewsletterPublisherPresentationModel.php
index 21fd228..ea6eaaf 100644
--- a/includes/Echo/EchoNewsletterPublisherPresentationModel.php
+++ b/includes/Echo/EchoNewsletterPublisherPresentationModel.php
@@ -8,7 +8,7 @@
 
public function getPrimaryLink() {
return array(
-   'url' => $this->getSpecialNewsletterUrl(),
+   'url' => $this->getNewsletterUrl(),
'label' => $this->msg( 
'newsletter-notification-link-text-new-publisher' )->text()
);
}
diff --git a/includes/Echo/EchoNewsletterSubscribedPresentationModel.php 
b/includes/Echo/EchoNewsletterSubscribedPresentationModel.php
index 989e5ee..24c4365 100644
--- a/includes/Echo/EchoNewsletterSubscribedPresentationModel.php
+++ b/includes/Echo/EchoNewsletterSubscribedPresentationModel.php
@@ -8,7 +8,7 @@
 
public function getPrimaryLink() {
return array(
-   'url' => $this->getSpecialNewsletterUrl(),
+   'url' => $this->getNewsletterUrl(),
'label' => $this->msg( 
'newsletter-notification-subscribed' )
->params( $this->getNewsletterName() )
);
diff --git a/includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php 
b/includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php
index 092d63d..9431cce 100644
--- a/includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php
+++ b/includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php
@@ -8,7 +8,7 @@
 
public function getPrimaryLink() {
return array(
-   'url' => $this->getSpecialNewsletterUrl(),
+   'url' => $this->getNewsletterUrl(),
'label' => $this->msg( 
'newsletter-notification-unsubscribed' )
->params( $this->getNewsletterName() )
);

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Add GENDER support to a few Echo messages

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

Change subject: Add GENDER support to a few Echo messages
..

Add GENDER support to a few Echo messages

* echo-email-plain-footer
* echo-email-html-footer-preference-link-text
* echo-email-html-footer-with-link

Bug: T145439
Change-Id: I2d55a617910efa11effef1a469e6d845eebc5591
---
M i18n/en.json
M i18n/qqq.json
M includes/formatters/EchoHtmlEmailFormatter.php
M includes/formatters/EchoPlainTextEmailFormatter.php
4 files changed, 9 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/96/329496/1

diff --git a/i18n/en.json b/i18n/en.json
index cf1f3ee..23e99e5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -203,9 +203,9 @@
"echo-email-body-default": "You have a new notification at 
{{SITENAME}}:\n\n$1",
"echo-email-footer-default-html": "To control which emails we send you, 
check your 
preferences.\n$1",
"echo-email-footer-default": "$2\n\nTo control which emails we send 
you, check your 
preferences:\n{{canonicalurl:{{#special:Preferences}}#mw-prefsection-echo}}\n\n$1",
-   "echo-email-plain-footer": "To control which emails we send you, check 
your preferences:",
-   "echo-email-html-footer-preference-link-text": "check your preferences",
-   "echo-email-html-footer-with-link": "To control which emails we send 
you, $1.",
+   "echo-email-plain-footer": "To control which emails we send 
{{GENDER:$1|you}}, check {{GENDER:$1|your}} preferences:",
+   "echo-email-html-footer-preference-link-text": "check 
{{GENDER:$1|your}} preferences",
+   "echo-email-html-footer-with-link": "To control which emails we send 
{{GENDER:$2|you}}, $1.",
"echo-notification-alert": "{{PLURAL:$1|Alert ($1)|Alerts 
($1)|100=Alerts (99+)}}",
"echo-notification-notice": "{{PLURAL:$1|Notice ($1)|Notices 
($1)|100=Notices (99+)}}",
"echo-notification-alert-text-only": "Alerts",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 44e5a52..7fb8eff 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -197,9 +197,9 @@
"echo-email-body-default": "Default message content for Echo email 
notifications. Parameters:\n* $1 - a plain text description of the 
notification",
"echo-email-footer-default-html": "Default footer content for Echo html 
e-mail notifications. Parameters:\n* $1 - the address of the organization that 
sent the email\n* $2 - the URL to the notification preference page\nFor 
plain-text version, see {{msg-mw|Echo-email-footer-default}}.",
"echo-email-footer-default": "Default footer content for Echo text 
e-mail notifications. Parameters:\n* $1 - the address of the organization that 
sent the email\n* $2 - \"---...\" 
({{msg-mw|echo-email-batch-separator}})\n\nFor HTML version, see 
{{msg-mw|echo-email-footer-default-html}}.",
-   "echo-email-plain-footer": "Footer content for Echo text e-mail 
notifications.\n\nFor HTML version, see {{msg-mw|echo-email-html-footer}}.",
-   "echo-email-html-footer-preference-link-text": "Text of link to the 
preference page in the footer of HTML emails.",
-   "echo-email-html-footer-with-link": "Footer content of the HTML 
email.\n* $1 - complete HTML link to the preference page.\n\nSee 
{{msg-mw|echo-email-html-footer-preference-link-text}} for the text of the 
link.",
+   "echo-email-plain-footer": "Footer content for Echo text e-mail 
notifications. Parameters:\n* $1 - the name of the user being addressed, used 
for GENDER\n\nFor HTML version, see {{msg-mw|echo-email-html-footer}}.",
+   "echo-email-html-footer-preference-link-text": "Text of link to the 
preference page in the footer of HTML emails. Parameters:\n* $1 - the name of 
the user being addressed, used for GENDER",
+   "echo-email-html-footer-with-link": "Footer content of the HTML email. 
Parameters:\n* $1 - complete HTML link to the preference page. $2 - the name of 
the user being addressed, used for GENDER\n\nSee 
{{msg-mw|echo-email-html-footer-preference-link-text}} for the text of the 
link.",
"echo-notification-alert": "Label for alert notifications (= non 
discussion notifications) tab in Echo overlay. Parameters:\n* $1 - the number 
of unread alerts. The number cannot be higher than 100.\nSee also:\n* 
{{msg-mw|Echo-notification-notice}}\n{{Identical|Alert}}",
"echo-notification-notice": "Label for notice notifications tab in Echo 
overlay. Parameters:\n* $1 - the number of unread notices. The number cannot be 
higher than 100.\nSee also:\n* 
{{msg-mw|Echo-notification-notice}}\n{{Identical|Notice}}",
"echo-notification-alert-text-only": "Label for alert notifications (= 
non discussion notifications) tab in Echo overlay without alert notification 
count next to it\n{{Identical|Alert}}",
diff --git a/includes/formatters/EchoHtmlEmailFormatter.php 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid use of &$this in hooks

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

Change subject: Avoid use of &$this in hooks
..

Avoid use of &$this in hooks

* This triggers warnings in PHP 7.1

Bug: T153505
Change-Id: I5324a6bfe9e8ed255975104c5de7e7a7011cb741
---
M includes/EditPage.php
1 file changed, 20 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/41/329341/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index 1f871e1..c11df5d 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2602,7 +2602,9 @@
$previewOutput = $this->getPreviewText();
}
 
-   Hooks::run( 'EditPage::showEditForm:initial', [ &$this, &$wgOut 
] );
+   // Avoid PHP 7.1 warning of passing $this by reference
+   $editPage = $this;
+   Hooks::run( 'EditPage::showEditForm:initial', [ &$editPage, 
&$wgOut ] );
 
$this->setHeaders();
 
@@ -2679,7 +2681,9 @@
. Xml::closeElement( 'div' )
);
 
-   Hooks::run( 'EditPage::showEditForm:fields', [ &$this, &$wgOut 
] );
+   // Avoid PHP 7.1 warning of passing $this by reference
+   $editPage = $this;
+   Hooks::run( 'EditPage::showEditForm:fields', [ &$editPage, 
&$wgOut ] );
 
// Put these up at the top to ensure they aren't lost on early 
form submission
$this->showFormBeforeText();
@@ -3541,7 +3545,9 @@
protected function showConflict() {
global $wgOut;
 
-   if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$this, 
&$wgOut ] ) ) {
+   // Avoid PHP 7.1 warning of passing $this by reference
+   $editPage = $this;
+   if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$editPage, 
&$wgOut ] ) ) {
$stats = 
MediaWikiServices::getInstance()->getStatsdDataFactory();
$stats->increment( 'edit.failures.conflict' );
// Only include 'standard' namespaces to avoid creating 
unknown numbers of statsd metrics
@@ -4069,7 +4075,10 @@
$checkboxes['watch'] = $watchThisHtml;
}
}
-   Hooks::run( 'EditPageBeforeEditChecks', [ &$this, &$checkboxes, 
&$tabindex ] );
+
+   // Avoid PHP 7.1 warning of passing $this by reference
+   $editPage = $this;
+   Hooks::run( 'EditPageBeforeEditChecks', [ &$editPage, 
&$checkboxes, &$tabindex ] );
return $checkboxes;
}
 
@@ -4118,7 +4127,9 @@
$buttons['diff'] = Html::submitButton( $this->context->msg( 
'showdiff' )->text(),
$attribs );
 
-   Hooks::run( 'EditPageBeforeEditButtons', [ &$this, &$buttons, 
&$tabindex ] );
+   // Avoid PHP 7.1 warning of passing $this by reference
+   $editPage = $this;
+   Hooks::run( 'EditPageBeforeEditButtons', [ &$editPage, 
&$buttons, &$tabindex ] );
return $buttons;
}
 
@@ -4132,7 +4143,10 @@
$wgOut->prepareErrorPage( $this->context->msg( 
'nosuchsectiontitle' ) );
 
$res = $this->context->msg( 'nosuchsectiontext', $this->section 
)->parseAsBlock();
-   Hooks::run( 'EditPageNoSuchSection', [ &$this, &$res ] );
+
+   // Avoid PHP 7.1 warning of passing $this by reference
+   $editPage = $this;
+   Hooks::run( 'EditPageNoSuchSection', [ &$editPage, &$res ] );
$wgOut->addHTML( $res );
 
$wgOut->returnToMain( false, $this->mTitle );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...LifeWeb[master]: Added a composer.json file in order to lint the PHP

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

Change subject: Added a composer.json file in order to lint the PHP
..

Added a composer.json file in order to lint the PHP

Bug: T154147
Change-Id: I5a787952de804978709cde5ae159f19410e72297
---
A composer.json
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LifeWeb 
refs/changes/36/329236/1

diff --git a/composer.json b/composer.json
new file mode 100644
index 000..90ed98b
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,15 @@
+{
+   "require-dev": {
+   "jakub-onderka/php-parallel-lint": "0.9.2",
+   "mediawiki/mediawiki-codesniffer": "0.7.2"
+   },
+   "scripts": {
+   "test": [
+   "parallel-lint . --exclude vendor",
+   "phpcs -p"
+   ],
+   "fix": [
+   "phpcbf"
+   ]
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a787952de804978709cde5ae159f19410e72297
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LifeWeb
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...LifeWeb[master]: Add missing API i18n messages

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

Change subject: Add missing API i18n messages
..

Add missing API i18n messages

* Migrate from old API message formats

Bug: T154092
Change-Id: I66006e707d40c63f91877ab6e47c846ec35f615a
---
M ApiLifeWeb.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 17 insertions(+), 18 deletions(-)


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

diff --git a/ApiLifeWeb.php b/ApiLifeWeb.php
index bbab415..7b2dc13 100644
--- a/ApiLifeWeb.php
+++ b/ApiLifeWeb.php
@@ -79,10 +79,6 @@
 return $result;
 }
 
-public function getDescription() {
-return 'Data downlink for the LifeBase.';
-}
-
 public function getAllowedParams() {
 return array(
 'what' => array (
@@ -111,19 +107,12 @@
 );
 }
 
-public function getParamDescription() {
-return array(
-'what' => 'Which data list to retrieve.'
-);
-}
-
 public function getExamples() {
 return array(
 'api.php?action=query=LifeWeb=taxonData=json'
-=> 'Taxon list',
+=> 'apihelp-query+LifeWeb-example-1',
 'api.php?action=query=LifeWeb=jsonfm=question'
-=> 'Question list, pretty-printed'
+=> 'apihelp-query+LifeWeb-example-2'
 );
 }
-
-}
\ No newline at end of file
+}
diff --git a/i18n/en.json b/i18n/en.json
index 0188997..7ca4b11 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,9 +1,14 @@
 {
"@metadata": {
"authors": [
-   "Simon A. Eugster"
+   "Simon A. Eugster",
+   "Justin Du"
]
},
"lifeweb": "LifeWeb",
-   "lifeweb-desc": "Identification key generator and editor"
+   "lifeweb-desc": "Identification key generator and editor",
+   "apihelp-query+LifeWeb-description": "Data downlink for the LifeBase.",
+   "apihelp-query+LifeWeb-param-what": "Which data list to retrieve.",
+   "apihelp-query+LifeWeb-example-1": "Taxon list",
+   "apihelp-query+LifeWeb-example-2": "Question list, pretty-printed"
 }
\ No newline at end of file
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 7d6eb26..dec8a7a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -2,9 +2,14 @@
"@metadata": {
"authors": [
"Shirayuki",
-   "Umherirrender"
+   "Umherirrender",
+   "Justin Du"
]
},
"lifeweb": "{{doc-special|LifeWeb}}",
-   "lifeweb-desc": "{{desc|name=Life 
Web|url=https://www.mediawiki.org/wiki/Extension:LifeWeb}};
+   "lifeweb-desc": "{{desc|name=Life 
Web|url=https://www.mediawiki.org/wiki/Extension:LifeWeb}};,
+   "apihelp-query+LifeWeb-description": 
"{{doc-apihelp-description|query+Lifeweb}}",
+   "apihelp-query+LifeWeb-param-what": 
"{{doc-apihelp-param|query+Lifeweb|what}}",
+   "apihelp-query+LifeWeb-example-1": 
"{{doc-apihelp-example|query+Lifeweb}}",
+   "apihelp-query+LifeWeb-example-2": 
"{{doc-apihelp-example|query+Lifeweb}}"
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66006e707d40c63f91877ab6e47c846ec35f615a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LifeWeb
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...SocialProfile[master]: Add missing API i18n messages:

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

Change subject: Add missing API i18n messages:
..

Add missing API i18n messages:

Bug: T153264
Change-Id: Ia0d237ef8e18b892fb0e84894a26ecdabc019f9a
---
M UserBoard/ApiDeleteUserBoardMessage.php
M UserBoard/ApiSendUserBoardMessage.php
M UserBoard/i18n/en.json
M UserBoard/i18n/qqq.json
M UserProfile/ApiUserProfilePrivacy.php
M UserProfile/i18n/en.json
M UserProfile/i18n/qqq.json
M UserRelationship/ApiRelationshipResponse.php
M UserRelationship/i18n/en.json
M UserRelationship/i18n/qqq.json
10 files changed, 34 insertions(+), 70 deletions(-)


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

diff --git a/UserBoard/ApiDeleteUserBoardMessage.php 
b/UserBoard/ApiDeleteUserBoardMessage.php
index b1428bb..b30d79c 100644
--- a/UserBoard/ApiDeleteUserBoardMessage.php
+++ b/UserBoard/ApiDeleteUserBoardMessage.php
@@ -27,10 +27,6 @@
return true;
}
 
-   public function getDescription() {
-   return 'Delete a UserBoard message.';
-   }
-
public function getAllowedParams() {
return array_merge( parent::getAllowedParams(), array(
'id' => array(
@@ -38,15 +34,5 @@
ApiBase::PARAM_REQUIRED => false
)
) );
-   }
-
-   public function getParamDescription() {
-   return array_merge( parent::getParamDescription(), array(
-   'id' => 'Unique identifier of the board message to 
delete.'
-   ) );
-   }
-
-   public function getExamplesMessages() {
-   return array();
}
 }
\ No newline at end of file
diff --git a/UserBoard/ApiSendUserBoardMessage.php 
b/UserBoard/ApiSendUserBoardMessage.php
index 5bf6622..6c311e6 100644
--- a/UserBoard/ApiSendUserBoardMessage.php
+++ b/UserBoard/ApiSendUserBoardMessage.php
@@ -36,10 +36,6 @@
return true;
}
 
-   public function getDescription() {
-   return 'Send a message to a user\'s UserBoard.';
-   }
-
public function getAllowedParams() {
return array_merge( parent::getAllowedParams(), array(
'username' => array(
@@ -55,17 +51,5 @@
ApiBase::PARAM_REQUIRED => false
)
) );
-   }
-
-   public function getParamDescription() {
-   return array_merge( parent::getParamDescription(), array(
-   'username' => 'The recipient\'s user name.',
-   'message' => 'urlencoded version of the message to 
send.',
-   'type' => 'Message type; 0 for a public message, 1 for 
a private message.'
-   ) );
-   }
-
-   public function getExamplesMessages() {
-   return array();
}
 }
\ No newline at end of file
diff --git a/UserBoard/i18n/en.json b/UserBoard/i18n/en.json
index ebf2335..bcdb9dc 100644
--- a/UserBoard/i18n/en.json
+++ b/UserBoard/i18n/en.json
@@ -60,5 +60,11 @@
"echo-category-title-social-msg": "User board messages",
"echo-pref-tooltip-social-msg": "Notify me when someone leaves a 
message on my user board.",
"notification-social-msg-send": "$1 just left a message on your user 
board.''$2''",
-   "notification-social-msg-send-bundle": "{{PLURAL:$1|One person|$1 
people|100=99+ people}} left messages on your user board."
+   "notification-social-msg-send-bundle": "{{PLURAL:$1|One person|$1 
people|100=99+ people}} left messages on your user board.",
+   "apihelp-senduserboardmessage-description": "Send a message to a user's 
UserBoard.",
+   "apihelp-senduserboardmessage-param-username": "The recipient's user 
name.",
+   "apihelp-senduserboardmessage-param-message": "A urlencoded version of 
the message to send.",
+   "apihelp-senduserboardmessage-param-type": "Message type: 0 for a 
public message, 1 for a private message.",
+   "apihelp-deleteuserboardmessage-description": "Delete a UserBoard 
message.",
+   "apihelp-deleteuserboardmessage-param-id": "Unique identifier of the 
board message to delete."
 }
diff --git a/UserBoard/i18n/qqq.json b/UserBoard/i18n/qqq.json
index 43a01aa..d0108ef 100644
--- a/UserBoard/i18n/qqq.json
+++ b/UserBoard/i18n/qqq.json
@@ -17,5 +17,11 @@
"userboard_prevpage": "{{Identical|Prev}}",
"userboard_sendbutton": "{{Identical|Send}}",
"userboard_showingmessages": "* '''$1''' is the total count of 
messages\n* '''$2''' is the number of the first message shown\n* '''$3''' is 
the number of the last message shown\n* '''$4''' is the count of messages 
acutally shown",
-   "right-userboard-delete": "{{doc-right|userboard-delete}}"
+   "right-userboard-delete": 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Show the user icon on watchlist page

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

Change subject: Show the user icon on watchlist page
..

Show the user icon on watchlist page

Bug: T146834
Change-Id: I7c1549a9edeb53d7a1846a357ac9c3cc066b303e
---
M includes/specials/MobileSpecialPageFeed.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/61/327361/1

diff --git a/includes/specials/MobileSpecialPageFeed.php 
b/includes/specials/MobileSpecialPageFeed.php
index 95fecac..81800f3 100644
--- a/includes/specials/MobileSpecialPageFeed.php
+++ b/includes/specials/MobileSpecialPageFeed.php
@@ -17,7 +17,10 @@
 */
public function execute( $par ) {
$out = $this->getOutput();
-   $out->addModuleStyles( 'mobile.special.pagefeed.styles' );
+   $out->addModuleStyles( [
+   'mobile.special.pagefeed.styles',
+   'skins.minerva.icons.images.scripts'
+   ] );
$this->setHeaders();
$out->setProperty( 'unstyledContent', true );
parent::execute( $par );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c1549a9edeb53d7a1846a357ac9c3cc066b303e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...ArticleFeedbackv5[master]: Replace Linker::link*() usage with LinkRenderer

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

Change subject: Replace Linker::link*() usage with LinkRenderer
..

Replace Linker::link*() usage with LinkRenderer

Bug: T149346
Change-Id: I0401f3a56803829eca040747631cb64b325d90a2
---
M ArticleFeedbackv5.hooks.php
M ArticleFeedbackv5.log.php
M ArticleFeedbackv5.render.php
M ArticleFeedbackv5.utils.php
M SpecialArticleFeedbackv5.php
M api/ApiViewActivityArticleFeedbackv5.php
6 files changed, 43 insertions(+), 25 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleFeedbackv5 
refs/changes/40/327140/1

diff --git a/ArticleFeedbackv5.hooks.php b/ArticleFeedbackv5.hooks.php
index 3006943..36843f5 100644
--- a/ArticleFeedbackv5.hooks.php
+++ b/ArticleFeedbackv5.hooks.php
@@ -1,4 +1,7 @@
 isHidden() || 
$record->isRequested() || $record->isOversighted() );
foreach ( $dateFormats as $format => &$formattedTime ) {
-   $formattedTime = Linker::link(
+   $formattedTime = 
MediawikiServices::getInstance()->getLinkRenderer()->makeLink(
$feedbackTitle,
-   htmlspecialchars( $formattedTime )
+   $formattedTime
);
if ( $historyDeleted ) {
$formattedTime = '' . $formattedTime . '';
diff --git a/ArticleFeedbackv5.log.php b/ArticleFeedbackv5.log.php
index a6374de..ab3982b 100644
--- a/ArticleFeedbackv5.log.php
+++ b/ArticleFeedbackv5.log.php
@@ -1,4 +1,7 @@
 getLinkRenderer()->makeLink(
$this->entry->getTarget(),
-   $this->msg( 'hist' )->escaped(),
+   $this->msg( 'hist' )->text(),
array(),
array(
'action' => 'history',
diff --git a/ArticleFeedbackv5.render.php b/ArticleFeedbackv5.render.php
index c95635e..75addbc 100644
--- a/ArticleFeedbackv5.render.php
+++ b/ArticleFeedbackv5.render.php
@@ -1,4 +1,7 @@
 getLinkRenderer();
// User info
if ( $record->aft_user == 0 ) {
// This is an anonymous (IP) user
@@ -394,7 +398,7 @@
// IPv4 - display the same way regular users 
are displayed
 
// display name = visitor's ip
-   $userName = Linker::link( $title, 
htmlspecialchars( $record->aft_user_text ) );
+   $userName = $linkRenderer->makeLink( $title, 
$record->aft_user_text );
} else {
// not IPv4 - display IP on next line (since 
IPv6 is rather long, it'd break our display)
 
@@ -402,7 +406,7 @@
$userName = wfMessage( 
'articlefeedbackv5-form-anon-username' )->escaped();
 
// additional line to be printed with the IPv6 
address (with link to contributions)
-   $userLink = Linker::link( $title, 
htmlspecialchars( $record->aft_user_text ) );
+   $userLink = $linkRenderer->makeLink( $title, 
$record->aft_user_text );
$anonMessage = wfMessage( 
'articlefeedbackv5-form-anon-message' )->rawParams( $userLink )->escaped();
}
} else {
@@ -417,7 +421,7 @@
}
 
// display name = username
-   $userName = Linker::link( $title, htmlspecialchars( 
$record->aft_user_text ) );
+   $userName = $linkRenderer->makeLink( $title, 
$record->aft_user_text );
}
 
if ( $this->isCentral ) {
@@ -426,7 +430,7 @@
$feedbackCentralPageTitle = Title::makeTitle( 
NS_SPECIAL, $centralPageName, "$record->aft_id" );
 
$userMessage = wfMessage( $message, 
$record->aft_user_text )
-   ->rawParams( $userName, Linker::linkKnown( 
$article ) )
+   ->rawParams( $userName, 
$linkRenderer->makeKnownLink( $article ) )
->params( 
$feedbackCentralPageTitle->getFullText() )
->parse();
} else {
@@ -472,9 +476,9 @@
Html::rawElement(
'span',
array( 'class' => 
'articleFeedbackv5-comment-details-link' ),
-   Linker::link(
+   
MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
SpecialPage::getTitleFor( 
'ArticleFeedbackv5', 

[MediaWiki-commits] [Gerrit] mediawiki...ArticleFeedback[master]: Replace Linker::link*() usage with LinkRenderer

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

Change subject: Replace Linker::link*() usage with LinkRenderer
..

Replace Linker::link*() usage with LinkRenderer

Bug: T149346
Change-Id: Ia18e0f2d7cf351f16f4584347cbbe1ff9a51bc7e
---
M SpecialArticleFeedback.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/SpecialArticleFeedback.php b/SpecialArticleFeedback.php
index 68bf375..1139c42 100644
--- a/SpecialArticleFeedback.php
+++ b/SpecialArticleFeedback.php
@@ -135,7 +135,7 @@
if ( !$pageTitle ) {
continue;
}
-   $row['page'] = Linker::link( $pageTitle, 
$pageTitle->getPrefixedText() );
+   $row['page'] = 
$this->getLinkRenderer()->makeLink( $pageTitle, $pageTitle->getPrefixedText() );
foreach ( $categories as $catid => $catmsg ) {
if ( isset( $page['ratings'][$catid] ) 
) {
$number = $this->formatNumber( 
$page['ratings'][$catid] );
@@ -187,7 +187,7 @@
foreach ( $this->getWeeklyMostChanged() as $page ) {
$row = array();
$pageTitle = Title::newFromText( $page['page'] );
-   $row['page'] = Linker::link( $pageTitle, 
$pageTitle->getPrefixedText() );
+   $row['page'] = $this->getLinkRenderer()->makeLink( 
$pageTitle, $pageTitle->getPrefixedText() );
foreach ( $categories as $catid => $catmsg ) {
if ( isset( $page['changes'][$catid] ) ) {
$number = $this->formatNumber( 
$page['changes'][$catid] );
@@ -237,7 +237,7 @@
if ( !$pageTitle ) {
continue;
}
-   $row['page'] = Linker::link( $pageTitle, 
$pageTitle->getPrefixedText() );
+   $row['page'] = $this->getLinkRenderer()->makeLink( 
$pageTitle, $pageTitle->getPrefixedText() );
foreach ( $categories as $catid => $catmsg ) {
if ( isset( $page['ratings'][$catid] ) ) {
$number = $this->formatNumber( 
$page['ratings'][$catid] );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia18e0f2d7cf351f16f4584347cbbe1ff9a51bc7e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleFeedback
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...ApprovedRevs[master]: Replace Linker::link*() usage with LinkRenderer and conver t...

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

Change subject: Replace Linker::link*() usage with LinkRenderer and conver to 
use [] array syntax
..

Replace Linker::link*() usage with LinkRenderer and conver to use [] array 
syntax

Change-Id: I6a79a40f7da4b08e70bb3196da5a623a788572e7
---
M ApprovedRevs.alias.php
M ApprovedRevs.hooks.php
M ApprovedRevs.i18n.magic.php
M ApprovedRevs.i18n.php
M ApprovedRevs.php
M ApprovedRevs_body.php
M SpecialApprovedRevsPage.php
M maintenance/approveAllPages.php
8 files changed, 248 insertions(+), 245 deletions(-)


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

diff --git a/ApprovedRevs.alias.php b/ApprovedRevs.alias.php
index 8827e6b..bd04764 100644
--- a/ApprovedRevs.alias.php
+++ b/ApprovedRevs.alias.php
@@ -5,164 +5,164 @@
  */
 // @codingStandardsIgnoreFile
 
-$specialPageAliases = array();
+$specialPageAliases = [];
 
 /** English (English) */
-$specialPageAliases['en'] = array(
-   'ApprovedRevs' => array( 'ApprovedRevs', 'ApprovedPages', 
'UnapprovedPages' ),
-);
+$specialPageAliases['en'] = [
+   'ApprovedRevs' => [ 'ApprovedRevs', 'ApprovedPages', 'UnapprovedPages' 
],
+];
 
 /** Arabic (العربية) */
-$specialPageAliases['ar'] = array(
-   'ApprovedRevs' => array( 'مراجعات_موفقة', 'صفحات_موفقة', 
'صفحات_غير_موفقة' ),
-);
+$specialPageAliases['ar'] = [
+   'ApprovedRevs' => [ 'مراجعات_موفقة', 'صفحات_موفقة', 'صفحات_غير_موفقة' ],
+];
 
 /** Egyptian Arabic (مصرى) */
-$specialPageAliases['arz'] = array(
-   'ApprovedRevs' => array( 'مراجعات_متوفقه', 'صفحات_متوافق_عليها', 
'صفحات_مش_متوافق_عليها' ),
-);
+$specialPageAliases['arz'] = [
+   'ApprovedRevs' => [ 'مراجعات_متوفقه', 'صفحات_متوافق_عليها', 
'صفحات_مش_متوافق_عليها' ],
+];
 
 /** Western Balochi (بلوچی رخشانی) */
-$specialPageAliases['bgn'] = array(
-   'ApprovedRevs' => array( 'سابیت_بوته_ئین_نخسه_ئان' ),
-);
+$specialPageAliases['bgn'] = [
+   'ApprovedRevs' => [ 'سابیت_بوته_ئین_نخسه_ئان' ],
+];
 
 /** Min Dong Chinese (Mìng-dĕ̤ng-ngṳ̄) */
-$specialPageAliases['cdo'] = array(
-   'ApprovedRevs' => array( '贊同其審閱' ),
-);
+$specialPageAliases['cdo'] = [
+   'ApprovedRevs' => [ '贊同其審閱' ],
+];
 
 /** German (Deutsch) */
-$specialPageAliases['de'] = array(
-   'ApprovedRevs' => array( 'Bestätigte_Versionen', 'Bestätigte_Seiten', 
'Unbestätigte_Seiten' ),
-);
+$specialPageAliases['de'] = [
+   'ApprovedRevs' => [ 'Bestätigte_Versionen', 'Bestätigte_Seiten', 
'Unbestätigte_Seiten' ],
+];
 
 /** Zazaki (Zazaki) */
-$specialPageAliases['diq'] = array(
-   'ApprovedRevs' => array( 'RewizyoniAraştkerden' ),
-);
+$specialPageAliases['diq'] = [
+   'ApprovedRevs' => [ 'RewizyoniAraştkerden' ],
+];
 
 /** Esperanto (Esperanto) */
-$specialPageAliases['eo'] = array(
-   'ApprovedRevs' => array( 'Aprobitaj_revizioj' ),
-);
+$specialPageAliases['eo'] = [
+   'ApprovedRevs' => [ 'Aprobitaj_revizioj' ],
+];
 
 /** Persian (فارسی) */
-$specialPageAliases['fa'] = array(
-   'ApprovedRevs' => array( 'نسخه‌های_تثبیت‌شده' ),
-);
+$specialPageAliases['fa'] = [
+   'ApprovedRevs' => [ 'نسخه‌های_تثبیت‌شده' ],
+];
 
 /** Galician (galego) */
-$specialPageAliases['gl'] = array(
-   'ApprovedRevs' => array( 'Aprobación_de_revisións' ),
-);
+$specialPageAliases['gl'] = [
+   'ApprovedRevs' => [ 'Aprobación_de_revisións' ],
+];
 
 /** Xiang Chinese (湘语) */
-$specialPageAliases['hsn'] = array(
-   'ApprovedRevs' => array( '受认定版本', '受认定页面', '冇认定个页面' ),
-);
+$specialPageAliases['hsn'] = [
+   'ApprovedRevs' => [ '受认定版本', '受认定页面', '冇认定个页面' ],
+];
 
 /** Haitian (Kreyòl ayisyen) */
-$specialPageAliases['ht'] = array(
-   'ApprovedRevs' => array( 'RevAprouve', 'PajAprouve', 'PajPaAprouve' ),
-);
+$specialPageAliases['ht'] = [
+   'ApprovedRevs' => [ 'RevAprouve', 'PajAprouve', 'PajPaAprouve' ],
+];
 
 /** Interlingua (interlingua) */
-$specialPageAliases['ia'] = array(
-   'ApprovedRevs' => array( 'Versiones_approbate' ),
-);
+$specialPageAliases['ia'] = [
+   'ApprovedRevs' => [ 'Versiones_approbate' ],
+];
 
 /** Italian (italiano) */
-$specialPageAliases['it'] = array(
-   'ApprovedRevs' => array( 'VersioniApprovate' ),
-);
+$specialPageAliases['it'] = [
+   'ApprovedRevs' => [ 'VersioniApprovate' ],
+];
 
 /** Korean (한국어) */
-$specialPageAliases['ko'] = array(
-   'ApprovedRevs' => array( '개정판승인', '문서승인' ),
-);
+$specialPageAliases['ko'] = [
+   'ApprovedRevs' => [ '개정판승인', '문서승인' ],
+];
 
 /** Cornish (kernowek) */
-$specialPageAliases['kw'] = array(
-   'ApprovedRevs' => array( 'AmendyansowKomendys' ),
-);
+$specialPageAliases['kw'] = [
+   'ApprovedRevs' => [ 'AmendyansowKomendys' ],
+];
 
 /** Luxembourgish (Lëtzebuergesch) */
-$specialPageAliases['lb'] = array(
-   'ApprovedRevs' => array( 'Net_nogekuckt_Säiten' ),
-);

[MediaWiki-commits] [Gerrit] mediawiki...SmiteSpam[master]: Escape raw HTML messages in SmiteSpam SpecialPages

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

Change subject: Escape raw HTML messages in SmiteSpam SpecialPages
..

Escape raw HTML messages in SmiteSpam SpecialPages

* Also replaced wfMessage() with $this->msg() where possible

Bug: T152831
Change-Id: Ia941e59a59be58db39e8853ed6633d13a1ea26f6
---
M SpecialSmiteSpam.php
M SpecialSmiteSpamTrustedUsers.php
2 files changed, 14 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SmiteSpam 
refs/changes/43/326243/1

diff --git a/SpecialSmiteSpam.php b/SpecialSmiteSpam.php
index 4640d43..004c063 100644
--- a/SpecialSmiteSpam.php
+++ b/SpecialSmiteSpam.php
@@ -22,12 +22,12 @@
$out->addHTML(
$this->getLinkRenderer()->makeLink(
SpecialPage::getTitleFor( 
'SmiteSpamTrustedUsers' ),
-   wfMessage( 'smitespam-view-trusted-users' 
)->text(),
+   $this->msg( 'smitespam-view-trusted-users' 
)->text(),
[ 'target' => '_blank' ]
)
);
 
-   $out->addHTML( '' . $this->msg( 
'smitespam-spam-pages-list-heading' )->text() . '' );
+   $out->addHTML( '' . $this->msg( 
'smitespam-spam-pages-list-heading' )->escaped() . '' );
 
$out->addHTML( '' );
 
@@ -42,14 +42,14 @@
$out->addHTML( '' );
 
$out->addHTML( '' );
+   . $this->msg( 'smitespam-delete-selected' )->escaped() 
. '" style="display:none;">' );
$out->addHTML( Html::openElement( 'div', [
'id' => 'smitespam-page-list',
] ) );
 
$out->addHTML( Html::closeElement( 'div' ) );
$out->addHTML( '' );
+   . $this->msg( 'smitespam-delete-selected' )->escaped() 
. '" style="display:none;">' );
$out->addHTML( Html::closeElement( 'form' ) );
 
$out->addModules( 'ext.SmiteSpam.retriever' );
diff --git a/SpecialSmiteSpamTrustedUsers.php b/SpecialSmiteSpamTrustedUsers.php
index dcb50f4..4a47303 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 )->escaped() . "" .
''
);
} 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' )->escaped() .
'' .
-   ' ' );
 
$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' 
)->escaped() . '' .
+   '' . $this->msg( 'smitespam-timestamp' )->escaped() 
. '' .
+   '' . 

[MediaWiki-commits] [Gerrit] translatewiki[master]: Support $1 as insertable parameters in the FUDforum project

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

Change subject: Support $1 as insertable parameters in the FUDforum project
..

Support $1 as insertable parameters in the FUDforum project

Bug: T150239
Change-Id: I16ddf5dc6ac286d99e187d7cab077acf2831822d
---
M groups/FUDforum/Suggester.php
1 file changed, 20 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/97/326197/1

diff --git a/groups/FUDforum/Suggester.php b/groups/FUDforum/Suggester.php
index 0d2a9ae..5310ff8 100644
--- a/groups/FUDforum/Suggester.php
+++ b/groups/FUDforum/Suggester.php
@@ -2,6 +2,7 @@
 
 /**
  * @author Siebrand Mazeland
+ * @author Justin Du
  * @license GPL-2.0+
  */
 class FudForumSuggester implements InsertablesSuggester {
@@ -10,12 +11,30 @@
 
// Variables like {VAR: }
$matches = [];
-   preg_match_all( '/{VAR: [^}]+}/', $text, $matches, 
PREG_SET_ORDER );
+   preg_match_all(
+   '/{VAR: [^}]+}/',
+   $text,
+   $matches,
+   PREG_SET_ORDER
+   );
$new = array_map( function( $match ) {
return new Insertable( "{$match[0]}", $match[0] );
}, $matches );
$insertables = array_merge( $insertables, $new );
 
+   // $1
+   $matches = [];
+   preg_match_all(
+   '/\$\d/',
+   $text,
+   $matches,
+   PREG_SET_ORDER
+   );
+   $new = array_map( function( $match ) {
+   return new Insertable( $match[0], $match[0] );
+   }, $matches );
+   $insertables = array_merge( $insertables, $new );
+
return $insertables;
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16ddf5dc6ac286d99e187d7cab077acf2831822d
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove WikiRevision::getText()

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

Change subject: Remove WikiRevision::getText()
..

Remove WikiRevision::getText()

* Deprecated and not used

Change-Id: I7e20596a2201859fbf2bb735496a2e0bd30ccf09
---
M includes/import/WikiRevision.php
1 file changed, 0 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/93/326193/1

diff --git a/includes/import/WikiRevision.php b/includes/import/WikiRevision.php
index 1e866f3..0384c2f 100644
--- a/includes/import/WikiRevision.php
+++ b/includes/import/WikiRevision.php
@@ -314,17 +314,6 @@
}
 
/**
-* @return string
-*
-* @deprecated Since 1.21, use getContent() instead.
-*/
-   function getText() {
-   wfDeprecated( __METHOD__, '1.21' );
-
-   return $this->text;
-   }
-
-   /**
 * @return ContentHandler
 */
function getContentHandler() {

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

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

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Support %s as insertable parameters in the lib.reviews project

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

Change subject: Support %s as insertable parameters in the lib.reviews project
..

Support %s as insertable parameters in the lib.reviews project

Bug: T150244
Change-Id: I82cd70bd492cc5cb881b63e807de12421ad3066b
---
A groups/lib.reviews/LibReviewsInsertablesSuggester.php
M groups/lib.reviews/lib.reviews.yaml
2 files changed, 35 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/86/326186/1

diff --git a/groups/lib.reviews/LibReviewsInsertablesSuggester.php 
b/groups/lib.reviews/LibReviewsInsertablesSuggester.php
new file mode 100644
index 000..68bc149
--- /dev/null
+++ b/groups/lib.reviews/LibReviewsInsertablesSuggester.php
@@ -0,0 +1,29 @@
+https://gerrit.wikimedia.org/r/326186
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82cd70bd492cc5cb881b63e807de12421ad3066b
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Support %1$s as insertable parameters in the MantisBT project

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

Change subject: Support %1$s as insertable parameters in the MantisBT project
..

Support %1$s as insertable parameters in the MantisBT project

Bug: T150250
Change-Id: Ica2197ecb766e201e03c3014182aed562cd38d03
---
M groups/MantisBT/MantisBT.yaml
A groups/MantisBT/MantisBTInsertablesSuggester.php
2 files changed, 35 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/79/326179/1

diff --git a/groups/MantisBT/MantisBT.yaml b/groups/MantisBT/MantisBT.yaml
index 4c24507..e273b8c 100644
--- a/groups/MantisBT/MantisBT.yaml
+++ b/groups/MantisBT/MantisBT.yaml
@@ -163,3 +163,9 @@
 
 FILES:
   sourcePattern: 
"%GROUPROOT%/mantis/plugins/XmlImportExport/lang/strings_%CODE%.txt"
+
+INSERTABLES:
+  class: MantisBTInsertablesSuggester
+
+AUTOLOAD:
+  MantisBTInsertablesSuggester: MantisBTInsertablesSuggester.php
diff --git a/groups/MantisBT/MantisBTInsertablesSuggester.php 
b/groups/MantisBT/MantisBTInsertablesSuggester.php
new file mode 100644
index 000..1fc4ba3
--- /dev/null
+++ b/groups/MantisBT/MantisBTInsertablesSuggester.php
@@ -0,0 +1,29 @@
+https://gerrit.wikimedia.org/r/326179
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica2197ecb766e201e03c3014182aed562cd38d03
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Support %1$s as insertable parameters in the NOCC Project

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

Change subject: Support %1$s as insertable parameters in the NOCC Project
..

Support %1$s as insertable parameters in the NOCC Project

Bug: T150251
Change-Id: Ic812a6512616e3e5d85523879144bc8bd4c10e46
---
M groups/Nocc/Nocc.yaml
A groups/Nocc/NoccInsertablesSuggester.php
2 files changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/74/326174/1

diff --git a/groups/Nocc/Nocc.yaml b/groups/Nocc/Nocc.yaml
index 9a4d0db..a177256 100644
--- a/groups/Nocc/Nocc.yaml
+++ b/groups/Nocc/Nocc.yaml
@@ -83,3 +83,9 @@
   class: MessageChecker
   checks:
 - printfCheck
+
+INSERTABLES:
+  class: NoccInsertablesSuggester
+
+AUTOLOAD:
+  NoccInsertablesSuggester: NoccInsertablesSuggester.php
diff --git a/groups/Nocc/NoccInsertablesSuggester.php 
b/groups/Nocc/NoccInsertablesSuggester.php
new file mode 100644
index 000..c29326d
--- /dev/null
+++ b/groups/Nocc/NoccInsertablesSuggester.php
@@ -0,0 +1,27 @@
+https://gerrit.wikimedia.org/r/326174
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic812a6512616e3e5d85523879144bc8bd4c10e46
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Support $1 as insertables in the Wikidata Query GUI (wikidat...

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

Change subject: Support $1 as insertables in the Wikidata Query GUI (wikidata) 
project
..

Support $1 as insertables in the Wikidata Query GUI (wikidata) project

Bug: T150253
Change-Id: Iff1c3361f793c40fda0188ee88fb20d05c2c5253
---
M groups/wikidata/wikidata.yaml
A groups/wikidata/wikidataInsertablesSuggester.php
2 files changed, 35 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/07/326107/1

diff --git a/groups/wikidata/wikidata.yaml b/groups/wikidata/wikidata.yaml
index 3eb61f7..d7a5054 100644
--- a/groups/wikidata/wikidata.yaml
+++ b/groups/wikidata/wikidata.yaml
@@ -26,3 +26,9 @@
 
 FILES:
   sourcePattern: "%GROUPROOT%/wikidata/query/gui/i18n/%CODE%.json"
+
+INSERTABLES:
+  class: wikidataInsertablesSuggester
+
+AUTOLOAD:
+  wikidataInsertablesSuggester: wikidataInsertablesSuggester.php
diff --git a/groups/wikidata/wikidataInsertablesSuggester.php 
b/groups/wikidata/wikidataInsertablesSuggester.php
new file mode 100644
index 000..71056de
--- /dev/null
+++ b/groups/wikidata/wikidataInsertablesSuggester.php
@@ -0,0 +1,29 @@
+https://gerrit.wikimedia.org/r/326107
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff1c3361f793c40fda0188ee88fb20d05c2c5253
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...SmiteSpam[master]: Remove unused 'smitespam-loading' message

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

Change subject: Remove unused 'smitespam-loading' message
..

Remove unused 'smitespam-loading' message

* It was removed in https://gerrit.wikimedia.org/r/#/c/235070/1

Change-Id: I6949b06afeaec58f7e618e10cd4b561ee188a610
---
M SmiteSpam.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/SmiteSpam.php b/SmiteSpam.php
index 455e537..163b4a0 100644
--- a/SmiteSpam.php
+++ b/SmiteSpam.php
@@ -50,7 +50,6 @@
'smitespam-created-by',
'smitespam-delete',
'smitespam-delete-page-failure-msg',
-   'smitespam-loading',
'smitespam-trust',
'smitespam-trusted',
'table_pager_next',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6949b06afeaec58f7e618e10cd4b561ee188a610
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SmiteSpam
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...SmiteSpam[master]: Replace Linker::link*() usage with LinkRenderer

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

Change subject: Replace Linker::link*() usage with LinkRenderer
..

Replace Linker::link*() usage with LinkRenderer

Bug: T149346
Change-Id: I71bde107d84ef38012bfb0624bfbab431ef0b532
---
M SpecialSmiteSpam.php
M SpecialSmiteSpamTrustedUsers.php
M api/SmiteSpamApiQuery.php
3 files changed, 12 insertions(+), 8 deletions(-)


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

diff --git a/SpecialSmiteSpam.php b/SpecialSmiteSpam.php
index 03a7318..4640d43 100644
--- a/SpecialSmiteSpam.php
+++ b/SpecialSmiteSpam.php
@@ -20,7 +20,7 @@
$numPages = SiteStats::pages();
 
$out->addHTML(
-   Linker::link(
+   $this->getLinkRenderer()->makeLink(
SpecialPage::getTitleFor( 
'SmiteSpamTrustedUsers' ),
wfMessage( 'smitespam-view-trusted-users' 
)->text(),
[ 'target' => '_blank' ]
diff --git a/SpecialSmiteSpamTrustedUsers.php b/SpecialSmiteSpamTrustedUsers.php
index f1e0c0f..dcb50f4 100644
--- a/SpecialSmiteSpamTrustedUsers.php
+++ b/SpecialSmiteSpamTrustedUsers.php
@@ -106,11 +106,12 @@
'' . wfMessage( 'smitespam-remove' )->text() . 
'' .
''
);
+   $linkRenderer = $this->getLinkRenderer();
foreach ( $result as $row ) {
$trustedUser = User::newFromID( $row->trusted_user_id 
)->getName();
-   $trustedUserContribsLink = Linker::link(
+   $trustedUserContribsLink = $linkRenderer->makeLink(
SpecialPage::getTitleFor( 'Contributions', 
$trustedUser ),
-   Sanitizer::escapeHtmlAllowEntities( 
$trustedUser ),
+   $trustedUser,
[ 'target' => '_blank' ]
);
$timestamp = $this->getLanguage()->userTimeAndDate(
@@ -118,9 +119,9 @@
$this->getUser()
);
$admin = User::newFromID( $row->trusted_user_admin_id 
)->getName();
-   $adminContribsLink = Linker::link(
+   $adminContribsLink = $linkRenderer->makeLink(
SpecialPage::getTitleFor( 'Contributions', 
$admin ),
-   Sanitizer::escapeHtmlAllowEntities( $admin ),
+   $admin,
[ 'target' => '_blank' ]
);
 
diff --git a/api/SmiteSpamApiQuery.php b/api/SmiteSpamApiQuery.php
index ab25093..bab89c1 100644
--- a/api/SmiteSpamApiQuery.php
+++ b/api/SmiteSpamApiQuery.php
@@ -1,5 +1,7 @@
 getMain()->getVal( 'offset' );
@@ -19,10 +21,11 @@
$pages = [];
$users = [];
 
+   $linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
foreach ( $spamPages as $page ) {
$title = $page->getTitle();
 
-   $titleLink = Linker::link(
+   $titleLink = $linkRenderer->makeLink(
$title,
null,
[ 'target' => '_blank' ]
@@ -44,9 +47,9 @@
$blocked = true;
}
$users[$creator] = [
-   'link' => Linker::link(
+   'link' => 
$linkRenderer->makeLink(

SpecialPage::getTitleFor( 'Contributions', $creator ),
-   
Sanitizer::escapeHtmlAllowEntities( $creator ),
+   $creator,
[ 'target' => 
'_blank' ]
),
'blocked' => 
(int)$blocked,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71bde107d84ef38012bfb0624bfbab431ef0b532
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SmiteSpam
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Support %1 as insertables for the Kiwix Project

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

Change subject: Support %1 as insertables for the Kiwix Project
..

Support %1 as insertables for the Kiwix Project

Bug: T150243
Change-Id: Ia5743bb0d1e3e6b25403495391083d36956343c2
---
M groups/Kiwix/Kiwix.yaml
A groups/Kiwix/KiwixInsertablesSuggester.php
2 files changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/17/325917/1

diff --git a/groups/Kiwix/Kiwix.yaml b/groups/Kiwix/Kiwix.yaml
index 3466f89..e5a69bd 100644
--- a/groups/Kiwix/Kiwix.yaml
+++ b/groups/Kiwix/Kiwix.yaml
@@ -15,3 +15,9 @@
   optional:
 - "*.accesskey"
 - ui.main.cssdirection
+
+INSERTABLES:
+  class: KiwixInsertablesSuggester
+
+AUTOLOAD:
+  KiwixInsertablesSuggester: KiwixInsertablesSuggester.php
diff --git a/groups/Kiwix/KiwixInsertablesSuggester.php 
b/groups/Kiwix/KiwixInsertablesSuggester.php
new file mode 100644
index 000..55c08de
--- /dev/null
+++ b/groups/Kiwix/KiwixInsertablesSuggester.php
@@ -0,0 +1,27 @@
+https://gerrit.wikimedia.org/r/325917
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5743bb0d1e3e6b25403495391083d36956343c2
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Define message 'newsletter-create-editsummary'

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

Change subject: Define message 'newsletter-create-editsummary'
..

Define message 'newsletter-create-editsummary'

Bug: T150095
Change-Id: I9473cfd39163cb085a5439cb8d32fee7cdf99400
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index fe8a51c..f0cd34c 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -17,6 +17,7 @@
"newslettercreate": "Create newsletter",
"newslettercreate-text": "This page allows you to create a new 
newsletter. You will be added as a publisher and subscribed to the newsletter 
on its creation. All fields are required.",
"newsletter-create-submit": "Create newsletter",
+   "newsletter-create-editsummary": "Create a new newsletter",
"newsletter-create-confirmation": "A new newsletter: 
[[Newsletter:$1|$1]] has been created.",
"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.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index eacaee0..055dd69 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -24,6 +24,7 @@
"newslettercreate": "Name of [[Special:CreateNewsletter]]. This is used 
as the header on this page and shown in links to the page.",
"newslettercreate-text": "Introductory message shown on top of 
Special:CreateNewsletter.",
"newsletter-create-submit": "Label of submit button on 
[[Special:CreateNewsletter]]",
+   "newsletter-create-editsummary": "Edit summary for creating a new 
newsletter on [[Special:CreateNewsletter]]",
"newsletter-create-confirmation": "Confirmation message displayed after 
creation of a newsletter. $1 - ID of the newsletter to be used for linking to 
Special:Newsletter.",
"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.",

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedMeta[master]: Replaced deprecated hooks

2016-12-06 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/325735

Change subject: Replaced deprecated hooks
..

Replaced deprecated hooks

* ArticleInsertComplete with PageContentInsertComplete
* ArticleSave with PageContentSave

Bug: T151973
Change-Id: Ia1cf2c80b366ee0185db1df7f3eb5cf53fcac965
---
M AdvancedMeta.class.php
1 file changed, 35 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AdvancedMeta 
refs/changes/35/325735/1

diff --git a/AdvancedMeta.class.php b/AdvancedMeta.class.php
index 85369f8..85bc7d1 100644
--- a/AdvancedMeta.class.php
+++ b/AdvancedMeta.class.php
@@ -32,13 +32,13 @@
// Inserts HTML for meta input fields into the edit page.
$wgHooks['ParserBeforeTidy'][] = $this;
 
-   // Before the updated text and properties of an article are 
saved to the database
+   // Before the updated text and properties of a wikiPage are 
saved to the database
// the new meta info is saved too
-   $wgHooks['ArticleSave'][] = $this;
+   $wgHooks['PageContentSave'][] = $this;
 
-   // If a new article is created the meta is temporarily saved as 
article ID '0'
-   // Move it to the newly created article now
-   $wgHooks['ArticleInsertComplete'][] = $this;
+   // If a new wikiPage is created the meta is temporarily saved 
as article ID '0'
+   // Move it to the newly created wikiPage now
+   $wgHooks['PageContentInsertComplete'][] = $this;
 
// Insert meta into article
$wgHooks['OutputPageBeforeHTML'][] = $this;
@@ -187,18 +187,28 @@
}
 
/**
-* Hook 2: Called during function doEdit() in /includes/Article.php
+* Hook 2: Called during function doEditContent() in 
/includes/page/WikiPage.php
 * Adds the new meta information to the database when an article is 
saved
 *
-* @param object $article The entire article and it's properties
-* @param object $user The user updating the article
+* @param object $wikiPage The entire Wikipage and its properties
+* @param object $user The User saving the article
+* @param object $content The new article content, as a Content object
+* @param string $summary The article summary, as a comment
+* @param boolean $isMinor Minor flag
+* @param boolean $isWatch Watch flag (not used, always null)
+* @param boolean $section section number (not used, always null)
+* @param unknown $flags Flags passed to Wikipage::doEditContent()
+* @param object $status
+*
 * @return true
 *
-* @global indexedpages , array of namespaces that should be indexed
+* @global indexedpages, array of namespaces that should be indexed
 *
 */
-   public function onArticleSave( &$article, &$user ) {
-   $id = $article->mTitle->getArticleID();
+   public function onPageContentSave( &$wikiPage, &$user, &$content, 
&$summary, $isMinor,
+   $isWatch, $section, &$flags, &$status ) {
+
+   $id = $wikiPage->mTitle->getArticleID();
 
// can this user edit meta for this page?
if ( !$this->canEditMeta() ) {
@@ -238,27 +248,28 @@
 * Hook 3: Called during function doEdit() in /includes/Article.php
 * Move the new meta information from a temporary id='0' to the new 
article's id
 *
-* @param object $article : the article (object) saved
-* @param object $user : the user (object) who saved the article
-* @param string $text : the new article content
-* @param string $summary : the article summary (comment)
-* @param bool $minoredit : minor edit flag
-* @param bool $watchthis : not used as of 1.8 (automatically set to 
"null")
-* @param bool $sectionanchor : not used as of 1.8 (automatically set 
to "null")
-* @param unknown $flags : bitfield, see source code for details; 
passed to Article::doedit()
-* @param object $revision : The newly inserted revision object (as of 
1.11.0)
+* @param object $wikiPage The entire Wikipage created and its 
properties
+* @param object $user The User creating the article
+* @param object $content The new article content, as a Content object
+* @param string $summary The edit summary, as a comment
+* @param boolean $isMinor Minor flag
+* @param boolean $isWatch Watch flag (not used, always null)
+* @param boolean $section section number (not used, always null)
+* @param unknown $flags Flags passed to Wikipage::doEditContent()
+* @param object $revision The newly inserted revision object
+*
 * @return true
 *
-   

[MediaWiki-commits] [Gerrit] translatewiki[master]: Support $1 as insertables in the Intuition Project

2016-12-05 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/325343

Change subject: Support $1 as insertables in the Intuition Project
..

Support $1 as insertables in the Intuition Project

Bug: T150242
Change-Id: I058da157d016054aa3c593aafccf193a9e70690a
---
M groups/Intuition/IntuitionAgg.yaml
A groups/Intuition/IntuitionInsertablesSuggester.php
M groups/Intuition/dcatap.yaml
M groups/Intuition/heritage.yaml
M groups/Intuition/orphantalk.yaml
M groups/Intuition/raun.yaml
M groups/Intuition/refill.yaml
7 files changed, 63 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/43/325343/1

diff --git a/groups/Intuition/IntuitionAgg.yaml 
b/groups/Intuition/IntuitionAgg.yaml
index 7fee2f0..67e0cb4 100644
--- a/groups/Intuition/IntuitionAgg.yaml
+++ b/groups/Intuition/IntuitionAgg.yaml
@@ -10,3 +10,9 @@
 GROUPS:
   - tsint-*
   - int-*
+
+INSERTABLES:
+  class: IntuitionInsertablesSuggester
+
+AUTOLOAD:
+  CopyPatrolInsertablesSuggester: IntuitionInsertablesSuggester.php
diff --git a/groups/Intuition/IntuitionInsertablesSuggester.php 
b/groups/Intuition/IntuitionInsertablesSuggester.php
new file mode 100644
index 000..52c4ce1
--- /dev/null
+++ b/groups/Intuition/IntuitionInsertablesSuggester.php
@@ -0,0 +1,27 @@
+https://gerrit.wikimedia.org/r/325343
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I058da157d016054aa3c593aafccf193a9e70690a
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Remove Special:Newsletter/id/delete forms completely from Ne...

2016-12-04 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/325249

Change subject: Remove Special:Newsletter/id/delete forms completely from 
Newsletter interface
..

Remove Special:Newsletter/id/delete forms completely from Newsletter interface

Bug: T152359
Bug: T152360
Bug: T152361
Change-Id: I8892b926c797a898d3a4d1190a730fdf5608454c
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/content/NewsletterContent.php
M includes/specials/SpecialNewsletter.php
5 files changed, 7 insertions(+), 131 deletions(-)


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

diff --git a/extension.json b/extension.json
index f8bc24c..729cec9 100644
--- a/extension.json
+++ b/extension.json
@@ -113,23 +113,6 @@
"newsletter-unsubscribe-error",
"newsletter-unsubscribe-success"
]
-   },
-   "ext.newsletter.delete": {
-   "scripts": "ext.newsletter.delete.js",
-   "position": "bottom",
-   "dependencies": [
-   "oojs-ui"
-   ],
-   "messages": [
-   "newsletter-delete-confirmation",
-   "newsletter-delete-confirm-details",
-   "newsletter-delete-confirm-cancel",
-   "newsletter-delete-confirm-delete"
-   ]
-   },
-   "ext.newsletter.newsletters.styles": {
-   "position": "top",
-   "styles": "ext.newsletter.newsletters.styles.css"
}
},
"ResourceFileModulePaths": {
diff --git a/i18n/en.json b/i18n/en.json
index 026ae1e..fe8a51c 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -28,7 +28,6 @@
"newsletter-subtitlelinks-subscribe": "subscribe",
"newsletter-subtitlelinks-announce": "announce",
"newsletter-subtitlelinks-manage": "manage",
-   "newsletter-subtitlelinks-delete": "delete",
"newsletters": "Newsletters",
"newsletter-subscribe-loginrequired": "Please log in to subscribe to 
[[Special:Newsletters|newsletters]].",
"newsletter-notfound": "Newsletter not found",
@@ -41,7 +40,6 @@
"newsletter-view-subscriber-count": "Subscriber count:",
"newsletter-view-no-publishers": "No publishers.",
"newsletter-view-issues-log": "Newsletter issue 
{{PLURAL:$1|announcement|announcements}}:",
-   "newsletter-delete-button": "Delete",
"newsletter-manage-button": "Manage",
"newsletter-unsubscribe-button": "Unsubscribe",
"newsletter-subscribe-button": "Subscribe",
@@ -69,10 +67,6 @@
"newsletter-manage-newsletter-nochanges": "No changes were made to the 
existing newsletter.",
"newsletter-manage-summary": "Summary of the change:",
"newsletter-delete": "Delete newsletter",
-   "newsletter-delete-text": "This interface can be used to delete the 
\"$1\" newsletter. Please confirm that you intend to do this. This 
action cannot be undone.",
-   "newsletter-delete-reason": "Reason",
-   "newsletter-deletenewsletter-button": "Delete this newsletter",
-   "newsletter-delete-success": "Newsletter \"$1\" has been deleted.",
"newsletter-delete-failure": "\"$1\" newsletter could not be deleted. 
Please try again.",
"newsletter-subscribe": "Newsletter subscription management",
"newsletter-subscribe-text": "This interface allows you to subscribe to 
\"$1\" newsletter. If you subscribe, you will receive notifications when new 
issues of this newsletter are announced.",
@@ -109,10 +103,6 @@
"newsletter-header-name": "Name",
"newsletter-header-description": "Description",
"newsletter-header-subscriber_count": "Subscribers",
-   "newsletter-delete-confirmation": "Are you sure you want to delete this 
newsletter?",
-   "newsletter-delete-confirm-details": "Note that this action is not 
reversible and data cannot be restored once it has been deleted.",
-   "newsletter-delete-confirm-cancel": "Cancel",
-   "newsletter-delete-confirm-delete": "Delete",
"right-newsletter-create": "Create newsletters",
"action-newsletter-create": "create newsletters",
"right-newsletter-delete": "Delete newsletters",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 0f1136c..eacaee0 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -31,11 +31,10 @@
"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 

[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: Fix all jslint errors

2016-12-02 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324892

Change subject: Fix all jslint errors
..

Fix all jslint errors

Bug: T96149
Change-Id: Ia2bbbc5aa1ce887d8bc25128894ffe30589725e7
---
M extensions/PropertySuggester/modules/ext.PropertySuggester.EntitySelector.js
1 file changed, 9 insertions(+), 17 deletions(-)


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

diff --git 
a/extensions/PropertySuggester/modules/ext.PropertySuggester.EntitySelector.js 
b/extensions/PropertySuggester/modules/ext.PropertySuggester.EntitySelector.js
index 2cd33c3..4b65e1b 100644
--- 
a/extensions/PropertySuggester/modules/ext.PropertySuggester.EntitySelector.js
+++ 
b/extensions/PropertySuggester/modules/ext.PropertySuggester.EntitySelector.js
@@ -32,9 +32,7 @@
this._oldCreate.apply( this, arguments );
 
var focusHandler = function( event ) {
-   if ( self._useSuggester()
-   && self.element.val() === ''
-   && !self.options.menu.element.is( 
':visible' )
+   if ( self._useSuggester() && self.element.val() 
=== '' && !self.options.menu.element.is( ':visible' )
) {
self.options.minTermLength = 0;
self._cache = {}; // is done in the 
entityselector on eachchange too
@@ -70,9 +68,7 @@
context: this._getPropertyContext(),
format: 'json',
language: this.options.language,
-   'continue': this._cache.term === term 
&& this._cache.nextSuggestionOffset
-   ? 
this._cache.nextSuggestionOffset
-   : 0
+   'continue': this._cache.term === term 
&& this._cache.nextSuggestionOffset ? this._cache.nextSuggestionOffset : 0
};
 
if ( data.context === 'item' ) {
@@ -101,15 +97,14 @@
 * @return {wikibase.Entity|null}
 */
_getEntity: function() {
+  var $entityView;
try {
-   var $entityView = this.element.closest( 
':wikibase-entityview' );
+   $entityView = this.element.closest( 
':wikibase-entityview' );
} catch ( ex ) {
return null;
}
 
-   return $entityView.length > 0
-   ? $entityView.data( 'entityview' ).option( 
'value' )
-   : null;
+   return $entityView.length > 0 ? $entityView.data( 
'entityview' ).option( 'value' ) : null;
},
 
/**
@@ -119,15 +114,14 @@
 * @return {string|null}
 */
_getPropertyId: function() {
+  var $statementview;
try {
-   var $statementview = this.element.closest( 
':wikibase-statementview' );
+   $statementview = this.element.closest( 
':wikibase-statementview' );
} catch ( ex ) {
return null;
}
 
-   var statement = $statementview.length > 0
-   ? $statementview.data( 'statementview' 
).option( 'value' )
-   : null;
+   var statement = $statementview.length > 0 ? 
$statementview.data( 'statementview' ).option( 'value' ) : null;
 
return statement ? 
statement.getClaim().getMainSnak().getPropertyId() : null;
},
@@ -183,9 +177,7 @@
 */
_isInNewStatementView: function() {
var $statementview = this.element.closest( 
':wikibase-statementview' ),
-   value = $statementview.length > 0
-   ? $statementview.data( 'statementview' 
).option( 'value' )
-   : null;
+   value = $statementview.length > 0 ? 
$statementview.data( 'statementview' ).option( 'value' ) : null;
 
return !value;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2bbbc5aa1ce887d8bc25128894ffe30589725e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikidata

[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Update Maintenance scripts to use $this->requireExtension() ...

2016-12-01 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324807

Change subject: Update Maintenance scripts to use $this->requireExtension() * 
Also added $this->mDescription to removeInvalidNotification
..

Update Maintenance scripts to use $this->requireExtension()
* Also added $this->mDescription to removeInvalidNotification

Bug: T152139
Change-Id: I146405a3b6e81680b0ee1fb081486170d914a2b1
---
M maintenance/backfillReadBundles.php
M maintenance/backfillUnreadWikis.php
M maintenance/generateSampleNotifications.php
M maintenance/processEchoEmailBatch.php
M maintenance/removeInvalidNotification.php
M maintenance/removeOrphanedEvents.php
M maintenance/testDiscussionParser.php
M maintenance/updateEchoSchemaForSuppression.php
8 files changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/07/324807/1

diff --git a/maintenance/backfillReadBundles.php 
b/maintenance/backfillReadBundles.php
index c6a54dd..66a8c64 100644
--- a/maintenance/backfillReadBundles.php
+++ b/maintenance/backfillReadBundles.php
@@ -13,6 +13,8 @@
$this->mDescription = "Backfill 
echo_notification.notification_read_timestamp for bundles";
 
$this->setBatchSize( 300 );
+
+   $this->requireExtension( 'Echo' );
}
 
public function execute() {
diff --git a/maintenance/backfillUnreadWikis.php 
b/maintenance/backfillUnreadWikis.php
index 9914309..18f13a8 100644
--- a/maintenance/backfillUnreadWikis.php
+++ b/maintenance/backfillUnreadWikis.php
@@ -13,6 +13,7 @@
$this->mDescription = "Backfill echo_unread_wikis table";
$this->addOption( 'rebuild', 'Only recompute already-existing 
rows' );
$this->setBatchSize( 300 );
+   $this->requireExtension( 'Echo' );
}
 
public function execute() {
diff --git a/maintenance/generateSampleNotifications.php 
b/maintenance/generateSampleNotifications.php
index 0793f83..8fd7994 100644
--- a/maintenance/generateSampleNotifications.php
+++ b/maintenance/generateSampleNotifications.php
@@ -55,6 +55,8 @@
'other',
'Name of another user involved with the notifications',
true, true, 'o' );
+
+   $this->requireExtension( 'Echo' );
}
 
public function execute() {
diff --git a/maintenance/processEchoEmailBatch.php 
b/maintenance/processEchoEmailBatch.php
index ad94331..34f726c 100644
--- a/maintenance/processEchoEmailBatch.php
+++ b/maintenance/processEchoEmailBatch.php
@@ -25,6 +25,8 @@
"ignoreConfiguredSchedule",
"Send all pending notifications immediately even if 
configured to be weekly or daily.",
false, false, "i" );
+
+   $this->requireExtension( 'Echo' );
}
 
public function execute() {
diff --git a/maintenance/removeInvalidNotification.php 
b/maintenance/removeInvalidNotification.php
index 588b564..65b4ddd 100644
--- a/maintenance/removeInvalidNotification.php
+++ b/maintenance/removeInvalidNotification.php
@@ -18,6 +18,11 @@
protected $batchSize = 500;
protected $invalidEventType = array( 'article-linked' );
 
+   public function __construct() {
+   $this->mDescription = "Removes invalid notifications from the 
database.";
+   $this->requireExtension( 'Echo' );
+   }
+
public function execute() {
if ( !$this->invalidEventType ) {
$this->output( "There is nothing to process\n" );
diff --git a/maintenance/removeOrphanedEvents.php 
b/maintenance/removeOrphanedEvents.php
index a639cd7..047265a 100644
--- a/maintenance/removeOrphanedEvents.php
+++ b/maintenance/removeOrphanedEvents.php
@@ -21,6 +21,8 @@
$this->mDescription = "Remove rows from echo_event that don't 
have corresponding rows in echo_notification";
 
$this->setBatchSize( 500 );
+
+   $this->requireExtension( 'Echo' );
}
 
public function getUpdateKey() {
diff --git a/maintenance/testDiscussionParser.php 
b/maintenance/testDiscussionParser.php
index 0f84dc7..baf3bb9 100644
--- a/maintenance/testDiscussionParser.php
+++ b/maintenance/testDiscussionParser.php
@@ -12,6 +12,8 @@
$this->mDescription = "Takes enwiki revision IDs and attempts 
to identify interested users";
 
$this->addArg( 'revisions', 'Revision IDs, separated by 
commas', true /*required*/ );
+
+   $this->requireExtension( 'Echo' );
}
 
public function execute() {
diff --git a/maintenance/updateEchoSchemaForSuppression.php 
b/maintenance/updateEchoSchemaForSuppression.php
index 6224af5..cfba653 100644
--- a/maintenance/updateEchoSchemaForSuppression.php
+++ 

[MediaWiki-commits] [Gerrit] mediawiki...UrlShortener[master]: Update Maintenance scripts to use $this->requireExtension()

2016-12-01 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324802

Change subject: Update Maintenance scripts to use $this->requireExtension()
..

Update Maintenance scripts to use $this->requireExtension()

Bug: T152139
Change-Id: I763202e2db3eff4146be4cac56229392140830ce
---
M maintenance/dumpURLs.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UrlShortener 
refs/changes/02/324802/1

diff --git a/maintenance/dumpURLs.php b/maintenance/dumpURLs.php
index 7ebee66..6e3a3df 100644
--- a/maintenance/dumpURLs.php
+++ b/maintenance/dumpURLs.php
@@ -17,6 +17,7 @@
$this->mDescription = 'Create a pipe-separated dump of all the 
short URL codes and their targets';
$this->addArg( 'file', 'Location to save the dump', true );
$this->setBatchSize( 1000 );
+   $this->requireExtension( 'UrlShortener' );
}
 
public function execute() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I763202e2db3eff4146be4cac56229392140830ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UrlShortener
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Update Maintenance scripts to use $this->requireExtension()

2016-12-01 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324803

Change subject: Update Maintenance scripts to use $this->requireExtension()
..

Update Maintenance scripts to use $this->requireExtension()

Bug: T152139
Change-Id: I5d8979c297db95beec4c5df439beaa2b58f266cf
---
M maintenance/update_scratch_token_format.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/maintenance/update_scratch_token_format.php 
b/maintenance/update_scratch_token_format.php
index 82f79f9..c0274c9 100644
--- a/maintenance/update_scratch_token_format.php
+++ b/maintenance/update_scratch_token_format.php
@@ -38,6 +38,7 @@
function __construct() {
parent::__construct();
$this->mDescription = 'Script to update scratch_token column 
format';
+   $this->requireExtension( 'OATHAuth' );
}
 
public function execute() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d8979c297db95beec4c5df439beaa2b58f266cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: Clarify grant-mwoath-authonly and grant-mwoath-authonlypriva...

2016-11-30 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324627

Change subject: Clarify grant-mwoath-authonly and grant-mwoath-authonlyprivate 
messages * Reword generic "API"  * Notify user of inability to read 
pages
..

Clarify grant-mwoath-authonly and grant-mwoath-authonlyprivate messages
* Reword generic "API"
* Notify user of inability to read pages

Bug: T145354
Change-Id: I69559c2cd5a059b3900ae2a92f12eb54b4ff37a6
---
M i18n/en.json
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/27/324627/1

diff --git a/i18n/en.json b/i18n/en.json
index 939c8c5..12bf632 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -228,8 +228,8 @@
"mwoauth-grants-nogrants": "The application has not requested any 
permissions.",
"mwoauth-acceptance-cancelled": "You have chosen not to allow \"$1\" to 
access your account. \"$1\" will not work unless you allow it access. You can 
go back to \"$1\" or [[Special:OAuthManageMyGrants|manage]] your connected 
apps.",
"mwoauth-granttype-normal": "Request authorization for specific 
permissions.",
-   "grant-mwoauth-authonly": "Authentication only, no API access.",
-   "grant-mwoauth-authonlyprivate": "Authentication only with access to 
real name and email address via Special:OAuth/identify, no API access.",
+   "grant-mwoauth-authonly": "User identity verification only, no ability 
to read pages or act on a user's behalf.",
+   "grant-mwoauth-authonlyprivate": "User identity verification only with 
access to real name and email address via Special:OAuth/identify, no ability to 
read pages or act on a user's behalf.",
"mwoauth-listgrants-extra-summary": "== OAuth-specific grants 
==\n\nThese additional grants are applicable to OAuth consumers.",
"mwoauth-oauth-exception": "An error occurred in the OAuth protocol: 
$1",
"mwoauth-callback-not-oob": "oauth_callback must be set, and must be 
set to \"oob\" (case-sensitive)",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I69559c2cd5a059b3900ae2a92f12eb54b4ff37a6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Replace makeLink() with makeBrokenLink() as [ 'broken' ] as ...

2016-11-30 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324620

Change subject: Replace makeLink() with makeBrokenLink() as [ 'broken' ] as a 
5th parameter is no longer supported.
..

Replace makeLink() with makeBrokenLink() as [ 'broken' ] as a 5th parameter is 
no longer supported.

Change-Id: If2025232a2e09ab99b1bdc6d58a77f347f3dbf5e
---
M includes/specials/SpecialBrokenRedirects.php
1 file changed, 1 insertion(+), 7 deletions(-)


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

diff --git a/includes/specials/SpecialBrokenRedirects.php 
b/includes/specials/SpecialBrokenRedirects.php
index 8927fbf..b730ecd 100644
--- a/includes/specials/SpecialBrokenRedirects.php
+++ b/includes/specials/SpecialBrokenRedirects.php
@@ -136,13 +136,7 @@
[ 'action' => 'edit' ]
);
}
-   $to = $linkRenderer->makeLink(
-   $toObj,
-   null,
-   [],
-   [],
-   [ 'broken' ]
-   );
+   $to = $linkRenderer->makeBrokenLink( $toObj );
$arr = $this->getLanguage()->getArrow();
 
$out = $from . $this->msg( 'word-separator' )->escaped();

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Change Return-To URL in Special:Newsletter/xx/delete to 'Ret...

2016-11-30 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324490

Change subject: Change Return-To URL in Special:Newsletter/xx/delete to 'Return 
to Newsletter:Foo' instead of 'Return to Special:Newsletter/1'  - Part of 
migration to ContentHandler
..

Change Return-To URL in Special:Newsletter/xx/delete to 'Return to 
Newsletter:Foo' instead of 'Return to Special:Newsletter/1'
- Part of migration to ContentHandler

Bug: T150123
Change-Id: Iae3b029d8a78cf37095d7386b50c7248eb9120ac
---
M includes/specials/SpecialNewsletter.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/specials/SpecialNewsletter.php 
b/includes/specials/SpecialNewsletter.php
index 90638d9..39b670d 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -647,7 +647,7 @@
 
if ( !$form->show() ) {
// After submission, no point in showing the return to 
link if the newsletter was just deleted
-   $out->addReturnTo( $this->getPageTitle( 
$this->newsletter->getId() ) );
+   $out->addReturnTo( Title::makeTitleSafe( NS_NEWSLETTER, 
$this->newsletter->getName() ) );
}
}
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Change Return-To URL in Special:Newsletter/xx/announce to 'R...

2016-11-29 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324361

Change subject: Change Return-To URL in Special:Newsletter/xx/announce to 
'Return to Newsletter:Foo' instead of 'Return to Special:Newsletter/1'- 
Part of migration to ContentHandler
..

Change Return-To URL in Special:Newsletter/xx/announce to 'Return to 
Newsletter:Foo' instead of 'Return to Special:Newsletter/1'
- Part of migration to ContentHandler

Bug: T150096
Change-Id: I82b494dd243250f906090dbaa85df8d5b1421481
---
M includes/specials/SpecialNewsletter.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/specials/SpecialNewsletter.php 
b/includes/specials/SpecialNewsletter.php
index fe6312c..90638d9 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -527,7 +527,7 @@
->numParams( 
$this->newsletter->getSubscriberCount() )
->parseAsBlock()
);
-   $out->addReturnTo( $this->getPageTitle( 
$this->newsletter->getId() ) );
+   $out->addReturnTo( Title::makeTitleSafe( NS_NEWSLETTER, 
$this->newsletter->getName() ) );
}
}
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Replace Linker::link() usage with LinkRenderer in the follow...

2016-11-29 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324355

Change subject: Replace Linker::link() usage with LinkRenderer in the following 
special pages:  - SpecialAllPages   - SpecialAncientpage- SpecialBlock  
- SpecialBrokenRedirects- SpecialDoubleRedirects
..

Replace Linker::link() usage with LinkRenderer in the following special pages:
- SpecialAllPages
- SpecialAncientpage
- SpecialBlock
- SpecialBrokenRedirects
- SpecialDoubleRedirects

Bug: T149346
Change-Id: Ib9997ec29b5c0079acb79dc2772196b38665145d
---
M includes/specials/SpecialAllPages.php
M includes/specials/SpecialAncientpages.php
M includes/specials/SpecialBlock.php
M includes/specials/SpecialBrokenRedirects.php
M includes/specials/SpecialDoubleRedirects.php
5 files changed, 37 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/324355/1

diff --git a/includes/specials/SpecialAllPages.php 
b/includes/specials/SpecialAllPages.php
index 4a2a619..4b8446a 100644
--- a/includes/specials/SpecialAllPages.php
+++ b/includes/specials/SpecialAllPages.php
@@ -204,6 +204,7 @@
]
);
 
+   $linkRenderer = $this->getLinkRenderer();
if ( $res->numRows() > 0 ) {
$out = Html::openElement( 'ul', [ 'class' => 
'mw-allpages-chunk' ] );
 
@@ -213,7 +214,7 @@
$out .= 'page_is_redirect 
? ' class="allpagesredirect"' : '' ) .
'>' .
-   Linker::link( $t ) .
+   
$linkRenderer->makeLink( $t ) .
"\n";
} else {
$out .= '[[' . 
htmlspecialchars( $s->page_title ) . "]]\n";
@@ -269,6 +270,7 @@
$navLinks = [];
$self = $this->getPageTitle();
 
+   $linkRenderer = $this->getLinkRenderer();
// Generate a "previous page" link if needed
if ( $prevTitle ) {
$query = [ 'from' => $prevTitle->getText() ];
@@ -281,9 +283,9 @@
$query['hideredirects'] = $hideredirects;
}
 
-   $navLinks[] = Linker::linkKnown(
+   $navLinks[] = $linkRenderer->makeKnownLink(
$self,
-   $this->msg( 'prevpage', $prevTitle->getText() 
)->escaped(),
+   $this->msg( 'prevpage', $prevTitle->getText() 
)->text(),
[],
$query
);
@@ -304,9 +306,9 @@
$query['hideredirects'] = $hideredirects;
}
 
-   $navLinks[] = Linker::linkKnown(
+   $navLinks[] = $linkRenderer->makeKnownLink(
$self,
-   $this->msg( 'nextpage', $t->getText() 
)->escaped(),
+   $this->msg( 'nextpage', $t->getText() )->text(),
[],
$query
);
diff --git a/includes/specials/SpecialAncientpages.php 
b/includes/specials/SpecialAncientpages.php
index 9ee1b75..ecc030e 100644
--- a/includes/specials/SpecialAncientpages.php
+++ b/includes/specials/SpecialAncientpages.php
@@ -78,9 +78,10 @@
 
$d = $this->getLanguage()->userTimeAndDate( $result->value, 
$this->getUser() );
$title = Title::makeTitle( $result->namespace, $result->title );
-   $link = Linker::linkKnown(
+   $linkRenderer = $this->getLinkRenderer();
+   $link = $linkRenderer->makeKnownLink(
$title,
-   htmlspecialchars( $wgContLang->convert( 
$title->getPrefixedText() ) )
+   $wgContLang->convert( $title->getPrefixedText() )
);
 
return $this->getLanguage()->specialList( $link, 
htmlspecialchars( $d ) );
diff --git a/includes/specials/SpecialBlock.php 
b/includes/specials/SpecialBlock.php
index ce7d24e..585f70b 100644
--- a/includes/specials/SpecialBlock.php
+++ b/includes/specials/SpecialBlock.php
@@ -372,12 +372,13 @@
 
$this->getOutput()->addModuleStyles( 'mediawiki.special' );
 
+   $linkRenderer = $this->getLinkRenderer();
# Link to the user's contributions, if applicable
if ( $this->target 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use isDisabled() instead of isBlank() in getGrantName in Use...

2016-11-29 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324337

Change subject: Use isDisabled() instead of isBlank() in getGrantName in 
User.php
..

Use isDisabled() instead of isBlank() in getGrantName in User.php

Bug: T151956
Change-Id: Ic23c75b784c725f8f73eb1cf98d2bdb3763ab09d
---
M includes/user/User.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/324337/1

diff --git a/includes/user/User.php b/includes/user/User.php
index 82d8806..4950e27 100644
--- a/includes/user/User.php
+++ b/includes/user/User.php
@@ -5066,13 +5066,14 @@
/**
 * Get the description of a given right
 *
+* @since 1.29
 * @param string $right Right to query
 * @return string Localized description of the right
 */
public static function getRightDescription( $right ) {
$key = "right-$right";
$msg = wfMessage( $key );
-   return $msg->isBlank() ? $right : $msg->text();
+   return $msg->isDisabled() ? $right : $msg->text();
}
 
/**

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: List grant codenames next to grants on Special:ListGrants

2016-11-29 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324151

Change subject: List grant codenames next to grants on Special:ListGrants
..

List grant codenames next to grants on Special:ListGrants

Bug: T145351
Change-Id: Ia07de6269fa6192071aaea5d750362685389001c
---
M includes/specials/SpecialListgrants.php
M includes/user/User.php
M languages/i18n/en.json
M languages/i18n/qqq.json
4 files changed, 22 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/324151/1

diff --git a/includes/specials/SpecialListgrants.php 
b/includes/specials/SpecialListgrants.php
index 39c8ae8..2c92410 100644
--- a/includes/specials/SpecialListgrants.php
+++ b/includes/specials/SpecialListgrants.php
@@ -71,8 +71,14 @@
 
$id = \Sanitizer::escapeId( $grant );
$out->addHTML( \Html::rawElement( 'tr', [ 'id' => $id ],
-   "" . $this->msg( "grant-$grant" 
)->escaped() . "" .
-   "" . $grantCellHtml . ''
+   "" .
+   $this->msg(
+   "listgrants-grant-display",
+   \User::getGrantName( $grant ),
+   "" . $id . ""
+   )->parse() .
+   "" .
+   "" . $grantCellHtml . ""
) );
}
 
diff --git a/includes/user/User.php b/includes/user/User.php
index 82d8806..99bedd7 100644
--- a/includes/user/User.php
+++ b/includes/user/User.php
@@ -5076,6 +5076,18 @@
}
 
/**
+* Get the name of a given grant
+*
+* @param string $grant Grant to query
+* @return string Localized name of the grant
+*/
+   public static function getGrantName( $grant ) {
+   $key = "grant-$grant";
+   $msg = wfMessage( $key );
+   return $msg->isBlank() ? $grant : $msg->text();
+   }
+
+   /**
 * Make a new-style password hash
 *
 * @param string $password Plain-text password
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 9aa0f46..0b85a4b 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2023,6 +2023,7 @@
"listgrants-summary": "The following is a list of grants with their 
associated access to user rights. Users can authorize applications to use their 
account, but with limited permissions based on the grants the user gave to the 
application. An application acting on behalf of a user cannot actually use 
rights that the user does not have however.\nThere may be 
[[{{MediaWiki:Listgrouprights-helppage}}|additional information]] about 
individual rights.",
"listgrants-grant": "Grant",
"listgrants-rights": "Rights",
+   "listgrants-grant-display": "$1 ($2)",
"trackingcategories": "Tracking categories",
"trackingcategories-summary": "This page lists tracking categories 
which are automatically populated by the MediaWiki software. Their names can be 
changed by altering the relevant system messages in the {{ns:8}} namespace.",
"trackingcategories-msg": "Tracking category",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 7327012..9a1cd65 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -2207,6 +2207,7 @@
"listgrants-summary": "Explanatory text shown at the top of the 
grant/rights mapping table.\n\nRefers to {{msg-mw|Listgrouprights-helppage}}.",
"listgrants-grant": "Used as table header for the grant/rights mapping 
table.\n{{Identical|Grant}}",
"listgrants-rights": "Used as table header for the grant/rights mapping 
table.\n{{Identical|Right}}",
+   "listgrants-grant-display": "{{optional}}\nUsed to display the code 
name of a grant next to the grant. Parameters:\n* $1 - the text from the 
\"grant-...\" messages, i.e. {{msg-mw|Grant-highvolume}}\n* $2 - the codename 
of this grant",
"trackingcategories": "[[Special:TrackingCategories]] page implementing 
list of Tracking categories [[mw:Special:MyLanguage/Help:Tracking 
categories|tracking category]].\n{{Identical|Tracking category}}",
"trackingcategories-summary": "Description for 
[[Special:TrackingCategories]] page [[mw:Help:Tracking categories|tracking 
category]]",
"trackingcategories-msg": "Header for the message column of the table 
on [[Special:TrackingCategories]]. This column lists the mediawiki message that 
controls the tracking category in question.\n{{Identical|Tracking category}}",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: List grant codenames next to grants on Special:ListGrants

2016-11-28 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/323993

Change subject: List grant codenames next to grants on Special:ListGrants
..

List grant codenames next to grants on Special:ListGrants

Bug: T145351
Change-Id: Id7fdf5a69536f7b903475c22389359f12ad2efee
---
M includes/specials/SpecialListgrants.php
M includes/user/User.php
M languages/i18n/en.json
M languages/i18n/qqq.json
4 files changed, 22 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/93/323993/1

diff --git a/includes/specials/SpecialListgrants.php 
b/includes/specials/SpecialListgrants.php
index 39c8ae8..2c92410 100644
--- a/includes/specials/SpecialListgrants.php
+++ b/includes/specials/SpecialListgrants.php
@@ -71,8 +71,14 @@
 
$id = \Sanitizer::escapeId( $grant );
$out->addHTML( \Html::rawElement( 'tr', [ 'id' => $id ],
-   "" . $this->msg( "grant-$grant" 
)->escaped() . "" .
-   "" . $grantCellHtml . ''
+   "" .
+   $this->msg(
+   "listgrants-grant-display",
+   \User::getGrantName( $grant ),
+   "" . $id . ""
+   )->parse() .
+   "" .
+   "" . $grantCellHtml . ""
) );
}
 
diff --git a/includes/user/User.php b/includes/user/User.php
index 82d8806..99bedd7 100644
--- a/includes/user/User.php
+++ b/includes/user/User.php
@@ -5076,6 +5076,18 @@
}
 
/**
+* Get the name of a given grant
+*
+* @param string $grant Grant to query
+* @return string Localized name of the grant
+*/
+   public static function getGrantName( $grant ) {
+   $key = "grant-$grant";
+   $msg = wfMessage( $key );
+   return $msg->isBlank() ? $grant : $msg->text();
+   }
+
+   /**
 * Make a new-style password hash
 *
 * @param string $password Plain-text password
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 9aa0f46..0b85a4b 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2023,6 +2023,7 @@
"listgrants-summary": "The following is a list of grants with their 
associated access to user rights. Users can authorize applications to use their 
account, but with limited permissions based on the grants the user gave to the 
application. An application acting on behalf of a user cannot actually use 
rights that the user does not have however.\nThere may be 
[[{{MediaWiki:Listgrouprights-helppage}}|additional information]] about 
individual rights.",
"listgrants-grant": "Grant",
"listgrants-rights": "Rights",
+   "listgrants-grant-display": "$1 ($2)",
"trackingcategories": "Tracking categories",
"trackingcategories-summary": "This page lists tracking categories 
which are automatically populated by the MediaWiki software. Their names can be 
changed by altering the relevant system messages in the {{ns:8}} namespace.",
"trackingcategories-msg": "Tracking category",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 7327012..9a1cd65 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -2207,6 +2207,7 @@
"listgrants-summary": "Explanatory text shown at the top of the 
grant/rights mapping table.\n\nRefers to {{msg-mw|Listgrouprights-helppage}}.",
"listgrants-grant": "Used as table header for the grant/rights mapping 
table.\n{{Identical|Grant}}",
"listgrants-rights": "Used as table header for the grant/rights mapping 
table.\n{{Identical|Right}}",
+   "listgrants-grant-display": "{{optional}}\nUsed to display the code 
name of a grant next to the grant. Parameters:\n* $1 - the text from the 
\"grant-...\" messages, i.e. {{msg-mw|Grant-highvolume}}\n* $2 - the codename 
of this grant",
"trackingcategories": "[[Special:TrackingCategories]] page implementing 
list of Tracking categories [[mw:Special:MyLanguage/Help:Tracking 
categories|tracking category]].\n{{Identical|Tracking category}}",
"trackingcategories-summary": "Description for 
[[Special:TrackingCategories]] page [[mw:Help:Tracking categories|tracking 
category]]",
"trackingcategories-msg": "Header for the message column of the table 
on [[Special:TrackingCategories]]. This column lists the mediawiki message that 
controls the tracking category in question.\n{{Identical|Tracking category}}",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Since linktitles and badges are presumed to be parameters, e...

2016-11-24 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/323493

Change subject: Since linktitles and badges are presumed to be parameters, 
enclose them in ... tags
..

Since linktitles and badges are presumed to be parameters, enclose them in 
... tags

Bug: T151587
Change-Id: Ic3d42aa24b2324167de79c64d414741c8279a1ed
---
M repo/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/93/323493/1

diff --git a/repo/i18n/en.json b/repo/i18n/en.json
index 7fef35e..892919d 100644
--- a/repo/i18n/en.json
+++ b/repo/i18n/en.json
@@ -634,7 +634,7 @@
"apihelp-wbsetsitelink-param-summary": "Summary for the edit.\nWill be 
prepended by an automatically generated comment. The length limit of the 
autocomment together with the summary is 260 characters. Be aware that 
everything above that limit will be cut off.",
"apihelp-wbsetsitelink-param-bot": "Mark this edit as bot. This URL 
flag will only be respected if the user belongs to the group \"bot\".",
"apihelp-wbsetsitelink-param-linksite": "The identifier of the site on 
which the article to link resides",
-   "apihelp-wbsetsitelink-param-linktitle": "The title of the article to 
link. If this parameter is an empty string or both linktitle and badges are not 
set, the link will be removed.",
+   "apihelp-wbsetsitelink-param-linktitle": "The title of the article to 
link. If this parameter is an empty string or both linktitle and 
badges are not set, the link will be removed.",
"apihelp-wbsetsitelink-param-badges": "The IDs of items to be set as 
badges. They will replace the current ones. If this parameter is not set, the 
badges will not be changed",
"apihelp-wbsetsitelink-example-1": "Add a sitelink to the English 
article \"Hydrogen\" to the item with ID \"Q42\", if the sitelink does not 
exist",
"apihelp-wbsetsitelink-example-2": "Add a sitelink to the English 
article \"Hydrogen\" to the item with ID \"Q42\", if the sitelink does not 
exist. Also appends \"Loves Oxygen\" to the edit summary.",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3d42aa24b2324167de79c64d414741c8279a1ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Use correct prefix lnt instead of le in the example url for ...

2016-11-21 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/322821

Change subject: Use correct prefix lnt instead of le in the example url for 
list=linterrors
..

Use correct prefix lnt instead of le in the example url for list=linterrors

Bug: T151284
Change-Id: Ib8ffbc9ee181e93da6b990ef8c788da7e49767cd
---
M includes/ApiQueryLintErrors.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/ApiQueryLintErrors.php b/includes/ApiQueryLintErrors.php
index d211dbf..89dfde4 100644
--- a/includes/ApiQueryLintErrors.php
+++ b/includes/ApiQueryLintErrors.php
@@ -118,7 +118,7 @@
 
public function getExamplesMessages() {
return [
-   'action=query=linterrors=obsolete-tag' 
=>
+   'action=query=linterrors=obsolete-tag' 
=>
'apihelp-query+linterrors-example-1',
];
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8ffbc9ee181e93da6b990ef8c788da7e49767cd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Linter
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: [WIP] Implement Undeleting a newsletter from the Logs

2016-11-08 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/320370

Change subject: [WIP] Implement Undeleting a newsletter from the Logs
..

[WIP] Implement Undeleting a newsletter from the Logs

Bug: T150125
Change-Id: Iba80892b596c46782aabffc1ed638132d7990503
---
M Newsletter.hooks.php
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/Newsletter.php
M includes/NewsletterDb.php
M includes/logging/NewsletterLogger.php
7 files changed, 82 insertions(+), 2 deletions(-)


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

diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php
index 4536962..241217f 100755
--- a/Newsletter.hooks.php
+++ b/Newsletter.hooks.php
@@ -208,4 +208,32 @@
}
return true;
}
+
+   /**
+* @param PageArchive $archive
+* @param Title $title
+*/
+   public static function onUndeleteForm( PageArchive &$archive, Title 
$title ) {
+   if ($title->inNamespace( NS_NEWSLETTER )) {
+   $store = NewsletterStore::getDefaultInstance();
+   $store->restoreNewsletter( $title->getText() );
+   }
+   $newsletter = Newsletter::newFromName( $title->getText() );
+   if ( $newsletter ) {
+   if ( !$newsletter->canRestore( $user ) ) {
+   throw new PermissionsError( 
'newsletter-restore' );
+   }
+   $success = NewsletterStore::getDefaultInstance()
+   ->restoreNewsletter( $newsletter, $reason );
+   if ( $success ) {
+   return $status->newGood();
+   } else {
+   // Show error message and allow resubmitting in 
case of failure
+   return $status->newFatal(
+   $wgOut->msg( 
'newsletter-restore-failure' )->rawParams( $newsletter->getName() )
+   );
+   }
+   }
+   return true;
+   }
 }
diff --git a/extension.json b/extension.json
index 5dcdb01..ab72928 100644
--- a/extension.json
+++ b/extension.json
@@ -161,6 +161,9 @@
],
"ArticleDelete": [
"NewsletterHooks::onArticleDelete"
+   ],
+   "UndeleteForm::undelete": [
+   "NewsletterHooks::onUndeleteForm"
]
},
"namespaces": [
diff --git a/i18n/en.json b/i18n/en.json
index 1c348bd..7557689 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -148,11 +148,13 @@
"logentry-newsletter-publisher-removed": "$1 {{GENDER:$2|removed}} 
{{GENDER:$6|$3}} as a publisher on newsletter $4",
"logentry-newsletter-newsletter-added": "$1 {{GENDER:$2|created}} 
newsletter $4",
"logentry-newsletter-newsletter-removed": "$1 {{GENDER:$2|deleted}} 
newsletter $4",
+   "logentry-newsletter-newsletter-restored": "$1 {{GENDER:$2|restored}} 
newsletter $4",
"logentry-newsletter-issue-added": "$1 {{GENDER:$2|published}} a new 
issue of $4 newsletter at $6",
"log-action-filter-newsletter": "Type of action:",
"log-action-filter-newsletter-publisher-added": "Publisher addition",
"log-action-filter-newsletter-publisher-removed": "Publisher removal",
"log-action-filter-newsletter-newsletter-added": "Newsletter creation",
"log-action-filter-newsletter-newsletter-removed": "Newsletter 
deletion",
-   "log-action-filter-newsletter-issue-added": "New issue announcements"
+   "log-action-filter-newsletter-issue-added": "New issue announcements",
+   "newsletter-restore-failure": "\"$1\" newsletter could not be restored. 
Please try again."
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2849c90..790cab8 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -155,11 +155,13 @@
"logentry-newsletter-publisher-removed": "{{logentry}}\n\nAdditional 
parameters:\n* $4 - the newsletter affected by the action\n* $6 - unused, or 
the full user name that was removed, whose display name is on $3 (to be used 
with GENDER)",
"logentry-newsletter-newsletter-added": "{{logentry}}\n\nAdditional 
parameters:\n* $4 - the newsletter affected by the action",
"logentry-newsletter-newsletter-removed": "{{logentry}}\n\nAdditional 
parameters:\n* $4 - the newsletter affected by the action",
+   "logentry-newsletter-newsletter-restored": "{{logentry}}\n\nAdditional 
parameters:\n* $4 - the newsletter affected by the action",
"logentry-newsletter-issue-added": "{{logentry}}\n\nAdditional 
parameters:\n* $4 - the newsletter affected by the action\n* $5 - ID of the 
issue (unused) \n* $6 - link to the issue page",

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make help link in sidebar same as main page default one

2016-11-03 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/319763

Change subject: Make help link in sidebar same as main page default one
..

Make help link in sidebar same as main page default one

Bug: T148004
Change-Id: I1bc8a84773e69529aed719ce36f1196f12b56226
---
M includes/installer/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/319763/1

diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json
index 1f7333a..b25ff2c 100644
--- a/includes/installer/i18n/en.json
+++ b/includes/installer/i18n/en.json
@@ -308,5 +308,5 @@
"config-nofile": "File \"$1\" could not be found. Has it been deleted?",
"config-extension-link": "Did you know that your wiki supports 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Extensions 
extensions]?\n\nYou can browse 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Category:Extensions_by_category
 extensions by category] or the 
[https://www.mediawiki.org/wiki/Extension_Matrix Extension Matrix] to see the 
full list of extensions.",
"mainpagetext": "MediaWiki has been installed.",
-   "mainpagedocfooter": "Consult the 
[https://meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on 
using the wiki software.\n\n== Getting started ==\n* 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings
 Configuration settings list]\n* 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]\n* 
[https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki 
release mailing list]\n* 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources
 Localise MediaWiki for your language]\n* 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn 
how to combat spam on your wiki]"
+   "mainpagedocfooter": "Consult the 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents] for 
information on using the wiki software.\n\n== Getting started ==\n* 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings
 Configuration settings list]\n* 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]\n* 
[https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki 
release mailing list]\n* 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources
 Localise MediaWiki for your language]\n* 
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn 
how to combat spam on your wiki]"
 }

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

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

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


  1   2   3   >