jenkins-bot has submitted this change and it was merged.
Change subject: Clean up block notices editing code
......................................................................
Clean up block notices editing code
* Don't rely on Article proxying method calls to WikiPage
* Use WikiPage::doEditContent() instead of the deprecated
WikiPage::doEdit()
* Only set EDIT_MINOR if the page exists to match EditPage logic
Bug: T105763
Change-Id: Ia8d3ddc7359980c300d8e3fbb3f5bb2f5bb5a54c
---
M specials/SpecialCheckUser.php
1 file changed, 12 insertions(+), 4 deletions(-)
Approvals:
Alex Monk: Looks good to me, approved
Legoktm: Looks good to me, but someone else must approve
Glaisher: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php
index 5f8af03..5c2e1f5 100644
--- a/specials/SpecialCheckUser.php
+++ b/specials/SpecialCheckUser.php
@@ -267,8 +267,8 @@
}
$userTitle = $u->getUserPage();
$userTalkTitle = $u->getTalkPage();
- $userpage = new Article( $userTitle );
- $usertalk = new Article( $userTalkTitle );
+ $userpage = WikiPage::factory( $userTitle );
+ $usertalk = WikiPage::factory( $userTalkTitle );
$safeUsers[] = '[[' . $userTitle->getPrefixedText() .
'|' . $userTitle->getText() . ']]';
$expirestr = $u->getId() ? 'indefinite' : '1 week';
$expiry = SpecialBlock::parseExpiryInput( $expirestr );
@@ -302,10 +302,18 @@
}
# Tag userpage! (check length to avoid mistakes)
if ( strlen( $tag ) > 2 ) {
- $userpage->doEdit( $tag, $reason, EDIT_MINOR );
+ $flags = 0;
+ if ( $userpage->exists() ) {
+ $flags |= EDIT_MINOR;
+ }
+ $userpage->doEditContent( new WikitextContent(
$tag ), $reason, $flags );
}
if ( strlen( $talkTag ) > 2 ) {
- $usertalk->doEdit( $talkTag, $reason,
EDIT_MINOR );
+ $flags = 0;
+ if ( $usertalk->exists() ) {
+ $flags |= EDIT_MINOR;
+ }
+ $usertalk->doEditContent( new WikitextContent(
$talkTag ), $reason, $flags );
}
}
return $safeUsers;
--
To view, visit https://gerrit.wikimedia.org/r/224559
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8d3ddc7359980c300d8e3fbb3f5bb2f5bb5a54c
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CheckUser
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Glaisher <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits