Index: branches/REL1_17/phase3/maintenance/language/messages.inc |
— | — | @@ -751,25 +751,6 @@ |
752 | 752 | 'suppressionlog', |
753 | 753 | 'suppressionlogtext', |
754 | 754 | ), |
755 | | - 'revisionmove' => array( |
756 | | - 'moverevlogentry', |
757 | | - 'revisionmove', |
758 | | - 'revisionmove-backlink', |
759 | | - 'revmove-explain', |
760 | | - 'revmove-legend', |
761 | | - 'revmove-submit', |
762 | | - 'revisionmoveselectedversions', |
763 | | - 'revmove-reasonfield', |
764 | | - 'revmove-titlefield', |
765 | | - 'revmove-badparam-title' , |
766 | | - 'revmove-badparam', |
767 | | - 'revmove-norevisions-title', |
768 | | - 'revmove-norevisions', |
769 | | - 'revmove-nullmove-title', |
770 | | - 'revmove-nullmove', |
771 | | - 'revmove-success-existing', |
772 | | - 'revmove-success-created', |
773 | | - ), |
774 | 755 | 'mergehistory' => array( |
775 | 756 | 'mergehistory', |
776 | 757 | 'mergehistory-header', |
— | — | @@ -1113,7 +1094,6 @@ |
1114 | 1095 | 'right-reset-passwords', |
1115 | 1096 | 'right-override-export-depth', |
1116 | 1097 | 'right-sendemail', |
1117 | | - 'right-revisionmove', |
1118 | 1098 | 'right-disableaccount', |
1119 | 1099 | ), |
1120 | 1100 | 'rightslog' => array( |
— | — | @@ -1157,7 +1137,6 @@ |
1158 | 1138 | 'action-userrights', |
1159 | 1139 | 'action-userrights-interwiki', |
1160 | 1140 | 'action-siteadmin', |
1161 | | - 'action-revisionmove', |
1162 | 1141 | ), |
1163 | 1142 | 'recentchanges' => array( |
1164 | 1143 | 'nchanges', |
— | — | @@ -3284,7 +3263,6 @@ |
3285 | 3264 | 'history-feed' => 'Revision feed', |
3286 | 3265 | 'revdelete' => 'Revision deletion', |
3287 | 3266 | 'suppression' => 'Suppression log', |
3288 | | - 'revisionmove' => 'Revision move', |
3289 | 3267 | 'mergehistory' => 'History merging', |
3290 | 3268 | 'mergelog' => 'Merge log', |
3291 | 3269 | 'diffs' => 'Diffs', |
Index: branches/REL1_17/phase3/maintenance/language/messageTypes.inc |
— | — | @@ -364,7 +364,6 @@ |
365 | 365 | 'prefs-memberingroups-type', |
366 | 366 | 'shared-repo-name-wikimediacommons', |
367 | 367 | 'usermessage-template', |
368 | | - 'revisionmove-backlink', |
369 | 368 | 'filepage.css', |
370 | 369 | ); |
371 | 370 | |
Index: branches/REL1_17/phase3/includes/Article.php |
— | — | @@ -1773,12 +1773,10 @@ |
1774 | 1774 | * on. |
1775 | 1775 | * @param $lastRevIsRedirect Boolean: if given, will optimize adding and |
1776 | 1776 | * removing rows in redirect table. |
1777 | | - * @param $setNewFlag Boolean: Set to true if a page flag should be set |
1778 | | - * Needed when $lastRevision has to be set to sth. !=0 |
1779 | 1777 | * @return bool true on success, false on failure |
1780 | 1778 | * @private |
1781 | 1779 | */ |
1782 | | - public function updateRevisionOn( &$dbw, $revision, $lastRevision = null, $lastRevIsRedirect = null, $setNewFlag = false ) { |
| 1780 | + public function updateRevisionOn( &$dbw, $revision, $lastRevision = null, $lastRevIsRedirect = null ) { |
1783 | 1781 | wfProfileIn( __METHOD__ ); |
1784 | 1782 | |
1785 | 1783 | $text = $revision->getText(); |
— | — | @@ -1791,15 +1789,11 @@ |
1792 | 1790 | $conditions['page_latest'] = $lastRevision; |
1793 | 1791 | } |
1794 | 1792 | |
1795 | | - if ( !$setNewFlag ) { |
1796 | | - $setNewFlag = ( $lastRevision === 0 ); |
1797 | | - } |
1798 | | - |
1799 | 1793 | $dbw->update( 'page', |
1800 | 1794 | array( /* SET */ |
1801 | 1795 | 'page_latest' => $revision->getId(), |
1802 | 1796 | 'page_touched' => $dbw->timestamp(), |
1803 | | - 'page_is_new' => $setNewFlag, |
| 1797 | + 'page_is_new' => ( $lastRevision === 0 ) ? 1 : 0, |
1804 | 1798 | 'page_is_redirect' => $rt !== null ? 1 : 0, |
1805 | 1799 | 'page_len' => strlen( $text ), |
1806 | 1800 | ), |
Index: branches/REL1_17/phase3/includes/HistoryPage.php |
— | — | @@ -417,23 +417,6 @@ |
418 | 418 | $s .= $element; |
419 | 419 | $this->buttons .= $element; |
420 | 420 | } |
421 | | - if ( $wgUser->isAllowed( 'revisionmove' ) ) { |
422 | | - $this->preventClickjacking(); |
423 | | - $float = $wgContLang->alignEnd(); |
424 | | - # Note bug #20966, <button> is non-standard in IE<8 |
425 | | - $element = Html::element( 'button', |
426 | | - array( |
427 | | - 'type' => 'submit', |
428 | | - 'name' => 'revisionmove', |
429 | | - 'value' => '1', |
430 | | - 'style' => "float: $float;", |
431 | | - 'class' => 'mw-history-revisionmove-button', |
432 | | - ), |
433 | | - wfMsg( 'revisionmoveselectedversions' ) |
434 | | - ) . "\n"; |
435 | | - $s .= $element; |
436 | | - $this->buttons .= $element; |
437 | | - } |
438 | 421 | $this->buttons .= '</div>'; |
439 | 422 | $s .= '</div><ul id="pagehistory">' . "\n"; |
440 | 423 | return $s; |
— | — | @@ -519,11 +502,10 @@ |
520 | 503 | |
521 | 504 | $del = ''; |
522 | 505 | // Show checkboxes for each revision |
523 | | - if ( $wgUser->isAllowed( 'deleterevision' ) || $wgUser->isAllowed( 'revisionmove' ) ) { |
| 506 | + if ( $wgUser->isAllowed( 'deleterevision' ) ) { |
524 | 507 | $this->preventClickjacking(); |
525 | 508 | // If revision was hidden from sysops, disable the checkbox |
526 | | - // However, if the user has revisionmove rights, we cannot disable the checkbox |
527 | | - if ( !$rev->userCan( Revision::DELETED_RESTRICTED ) && !$wgUser->isAllowed( 'revisionmove' ) ) { |
| 509 | + if ( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
528 | 510 | $del = Xml::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) ); |
529 | 511 | // Otherwise, enable the checkbox... |
530 | 512 | } else { |
Index: branches/REL1_17/phase3/includes/AutoLoader.php |
— | — | @@ -617,7 +617,6 @@ |
618 | 618 | 'RevDel_ArchivedFileItem' => 'includes/revisiondelete/RevisionDelete.php', |
619 | 619 | 'RevDel_LogList' => 'includes/revisiondelete/RevisionDelete.php', |
620 | 620 | 'RevDel_LogItem' => 'includes/revisiondelete/RevisionDelete.php', |
621 | | - 'SpecialRevisionMove' => 'includes/specials/SpecialRevisionMove.php', |
622 | 621 | 'ShortPagesPage' => 'includes/specials/SpecialShortpages.php', |
623 | 622 | 'SpecialActiveUsers' => 'includes/specials/SpecialActiveusers.php', |
624 | 623 | 'SpecialAllpages' => 'includes/specials/SpecialAllpages.php', |
Index: branches/REL1_17/phase3/includes/Wiki.php |
— | — | @@ -452,8 +452,6 @@ |
453 | 453 | if ( $action === 'historysubmit' ) { |
454 | 454 | if ( $request->getBool( 'revisiondelete' ) ) { |
455 | 455 | $action = 'revisiondelete'; |
456 | | - } elseif ( $request->getBool( 'revisionmove' ) ) { |
457 | | - $action = 'revisionmove'; |
458 | 456 | } else { |
459 | 457 | $action = 'view'; |
460 | 458 | } |
— | — | @@ -542,11 +540,6 @@ |
543 | 541 | $special = SpecialPage::getPage( 'Revisiondelete' ); |
544 | 542 | $special->execute( '' ); |
545 | 543 | break; |
546 | | - case 'revisionmove': |
547 | | - // For revision move submission from history page |
548 | | - $special = SpecialPage::getPage( 'RevisionMove' ); |
549 | | - $special->execute( '' ); |
550 | | - break; |
551 | 544 | default: |
552 | 545 | if( wfRunHooks( 'UnknownAction', array( $action, $article ) ) ) { |
553 | 546 | $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' ); |
Index: branches/REL1_17/phase3/includes/DefaultSettings.php |
— | — | @@ -4746,7 +4746,6 @@ |
4747 | 4747 | 'upload/revert' => 'uploadedimage', |
4748 | 4748 | 'move/move' => '1movedto2', |
4749 | 4749 | 'move/move_redir' => '1movedto2_redir', |
4750 | | - 'move/move_rev' => 'moverevlogentry', |
4751 | 4750 | 'import/upload' => 'import-logentry-upload', |
4752 | 4751 | 'import/interwiki' => 'import-logentry-interwiki', |
4753 | 4752 | 'merge/merge' => 'pagemerge-logentry', |
Index: branches/REL1_17/phase3/includes/specials/SpecialRevisionMove.php |
— | — | @@ -1,403 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * Implements Special:RevisionMove |
5 | | - * |
6 | | - * This program is free software; you can redistribute it and/or modify |
7 | | - * it under the terms of the GNU General Public License as published by |
8 | | - * the Free Software Foundation; either version 2 of the License, or |
9 | | - * (at your option) any later version. |
10 | | - * |
11 | | - * This program is distributed in the hope that it will be useful, |
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | - * GNU General Public License for more details. |
15 | | - * |
16 | | - * You should have received a copy of the GNU General Public License along |
17 | | - * with this program; if not, write to the Free Software Foundation, Inc., |
18 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
19 | | - * http://www.gnu.org/copyleft/gpl.html |
20 | | - * |
21 | | - * @file |
22 | | - * @ingroup SpecialPage |
23 | | - */ |
24 | | - |
25 | | -/** |
26 | | - * Special page allowing users with the appropriate permissions to |
27 | | - * move revisions of a page to a new target (either an existing page or not) |
28 | | - * |
29 | | - * The user selects revisions in the page history (HistoryPage.php), |
30 | | - * clicks on the submit button and gets this special page. |
31 | | - * A form is shown (showForm()) where the user has to enter a target page |
32 | | - * name and confirm the action with a post request & edit token. |
33 | | - * Then submit() is called, which does some checks and calls moveRevisions(). |
34 | | - * If the target doesn't exist, a new page gets created. rev_page of the |
35 | | - * selected revisions is updated, after that it is determined whether page_latest |
36 | | - * of the target page and the source page require an update. |
37 | | - * |
38 | | - * **** NOTE: This feature is EXPERIMENTAL. **** |
39 | | - * **** Do not use on any productive system. **** |
40 | | - * |
41 | | - * @ingroup SpecialPage |
42 | | - * @todo In case page_deleted gets introduced some day, use it. |
43 | | - * Currently it is possible with RevisionMove to make the latest revision |
44 | | - * of a page a RevisionDeleted one. When that happens, the user is presented |
45 | | - * an empty page with no error message whatsoever (in case he is not permitted |
46 | | - * to view deleted edits). |
47 | | -*/ |
48 | | -class SpecialRevisionMove extends UnlistedSpecialPage { |
49 | | - # common objects |
50 | | - var $mOldTitle; # Title object. |
51 | | - var $mNewTitle; # Title object. Desired new title |
52 | | - var $request; # WebRequest object, $wgRequest by default |
53 | | - var $skin; # Skin object |
54 | | - var $user; # User object |
55 | | - |
56 | | - # variables |
57 | | - var $mIds; # Array of Ids to look at |
58 | | - var $mRevlist; # RevDel_RevisionList object - borrowed from RevisionDelete |
59 | | - var $mReason; # User-supplied reason for performing the move operation |
60 | | - var $mSubmit; # Boolean: Is this a submitted request? |
61 | | - var $mIsAllowedRevisionMove = false; |
62 | | - |
63 | | - public function __construct( $name = 'RevisionMove' ) { |
64 | | - parent::__construct( $name ); |
65 | | - } |
66 | | - |
67 | | - /** |
68 | | - * @param $par subpage part, standard special page parameter, is ignored here |
69 | | - * |
70 | | - * Mostly initializes variables and calls either showForm() or submit() |
71 | | - */ |
72 | | - public function execute( $par ) { |
73 | | - global $wgUser, $wgOut; |
74 | | - |
75 | | - $this->setHeaders(); |
76 | | - $this->outputHeader(); |
77 | | - |
78 | | - $this->mIsAllowedRevisionMove = $wgUser->isAllowed( 'revisionmove' ); |
79 | | - $this->user = $wgUser; |
80 | | - $this->skin = $wgUser->getSkin(); |
81 | | - |
82 | | - if ( !$this->request instanceof WebRequest ) { |
83 | | - $this->request = $GLOBALS['wgRequest']; |
84 | | - } |
85 | | - |
86 | | - # Get correct title |
87 | | - if ( $this->request->getVal( 'action' ) == 'historysubmit' ) { |
88 | | - $this->mOldTitle = Title::newFromText( $this->request->getVal( 'title' ) ); |
89 | | - } else { |
90 | | - $this->mOldTitle = Title::newFromText( $this->request->getVal( 'oldTitle' ) ); |
91 | | - } |
92 | | - |
93 | | - if ( !$this->mOldTitle instanceof Title ) { |
94 | | - $wgOut->showErrorPage( 'revmove-badparam-title', 'revmove-badparam' ); |
95 | | - return; |
96 | | - } |
97 | | - |
98 | | - $wgOut->setPagetitle( wfMsg( 'revisionmove', $this->mOldTitle->getPrefixedText() ) ); |
99 | | - $oldTitleLink = $this->skin->link( $this->mOldTitle ); |
100 | | - $wgOut->setSubtitle( wfMsg( 'revisionmove-backlink', $oldTitleLink ) ); |
101 | | - |
102 | | - $this->mReason = $this->request->getText( 'wpReason' ); |
103 | | - |
104 | | - # TODO maybe not needed here? Copied from SpecialRevisiondelete.php. |
105 | | - # Keep for now, allow different inputs |
106 | | - # Handle our many different possible input types for ids |
107 | | - $ids = $this->request->getVal( 'ids' ); |
108 | | - if ( !is_null( $ids ) ) { |
109 | | - # Allow CSV, for backwards compatibility, or a single ID for show/hide links |
110 | | - $this->mIds = explode( ',', $ids ); |
111 | | - } else { |
112 | | - # Array input |
113 | | - $this->mIds = array_keys( $this->request->getArray( 'ids', array() ) ); |
114 | | - } |
115 | | - $this->mIds = array_unique( array_filter( $this->mIds ) ); |
116 | | - |
117 | | - if ( is_null ( $this->mIds ) ) { |
118 | | - $wgOut->showErrorPage( 'revmove-badparam-title', 'revmove-badparam' ); |
119 | | - return; |
120 | | - } |
121 | | - $this->mRevlist = new RevDel_RevisionList( $this, $this->mOldTitle, $this->mIds ); |
122 | | - |
123 | | - # Decide what to do: Show the form, or submit the changes |
124 | | - if ( $this->request->wasPosted() ) { |
125 | | - $this->submit(); |
126 | | - } else { |
127 | | - $this->showForm(); |
128 | | - } |
129 | | - } |
130 | | - |
131 | | - /** |
132 | | - * Show a list of items that we will operate on and a field for the target name |
133 | | - */ |
134 | | - public function showForm() { |
135 | | - global $wgOut, $wgUser; |
136 | | - |
137 | | - if ( !$this->mIsAllowedRevisionMove ) { |
138 | | - $permErrors = $this->mOldTitle->getUserPermissionsErrors( 'revisionmove', $this->user ); |
139 | | - $wgOut->showPermissionsErrorPage( $permErrors, 'revisionmove' ); |
140 | | - return false; |
141 | | - } |
142 | | - |
143 | | - $wgOut->addWikiMsg( 'revmove-explain', $this->mOldTitle->getPrefixedText() ); |
144 | | - $listNotEmpty = $this->listItems(); |
145 | | - if ( !$listNotEmpty ) { |
146 | | - return; # we're done, we already displayed an error earlier |
147 | | - } |
148 | | - |
149 | | - $out = Xml::openElement( 'form', array( 'method' => 'post', |
150 | | - 'action' => $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ), |
151 | | - 'id' => 'mw-revmove-form' ) ) . |
152 | | - Xml::fieldset( wfMsg( 'revmove-legend' ) ) . |
153 | | - Html::hidden( 'wpEditToken', $wgUser->editToken() ) . |
154 | | - Html::hidden( 'oldTitle', $this->mOldTitle->getPrefixedText() ) . |
155 | | - '<div>' . Xml::inputLabel( wfMsg( 'revmove-reasonfield' ), 'wpReason', 'revmove-reasonfield', 60 ) . '</div>' . |
156 | | - Xml::inputLabel( wfMsg( 'revmove-titlefield' ), 'newTitle', 'revmove-titlefield', 20, $this->mOldTitle->getPrefixedText() ) . |
157 | | - Html::hidden( 'ids', implode( ',', $this->mIds ) ) . |
158 | | - Xml::submitButton( wfMsg( 'revmove-submit' ), |
159 | | - array( 'name' => 'wpSubmit' ) ) . |
160 | | - Xml::closeElement( 'fieldset' ) . "\n" . |
161 | | - Xml::closeElement( 'form' ) . "\n"; |
162 | | - $wgOut->addHTML( $out ); |
163 | | - } |
164 | | - |
165 | | - /** |
166 | | - * Show a list of selected revisions and check the input |
167 | | - */ |
168 | | - protected function listItems() { |
169 | | - global $wgOut; |
170 | | - |
171 | | - $wgOut->addHTML( "<ul>" ); |
172 | | - |
173 | | - $numRevisions = 0; |
174 | | - |
175 | | - # No revisions specified at all |
176 | | - if ( $this->mIds == array() ) { |
177 | | - $wgOut->showErrorPage( 'revmove-norevisions-title', 'revmove-norevisions' ); |
178 | | - return false; |
179 | | - } |
180 | | - |
181 | | - for ( $this->mRevlist->reset(); $this->mRevlist->current(); $this->mRevlist->next() ) { |
182 | | - $item = $this->mRevlist->current(); |
183 | | - $numRevisions++; |
184 | | - $wgOut->addHTML( $item->getHTML() ); |
185 | | - } |
186 | | - |
187 | | - # No valid revisions specified (e.g. only revs belonging to another page) |
188 | | - if ( $numRevisions == 0 ) { |
189 | | - $wgOut->showErrorPage( 'revmove-norevisions-title', 'revmove-norevisions' ); |
190 | | - return false; |
191 | | - } |
192 | | - |
193 | | - $wgOut->addHTML( "</ul>" ); |
194 | | - |
195 | | - return true; |
196 | | - } |
197 | | - |
198 | | - /** |
199 | | - * Submit the posted changes (in $this->request). |
200 | | - * |
201 | | - * This function does some checks and then calls moveRevisions(), which does the real work |
202 | | - */ |
203 | | - public function submit() { |
204 | | - global $wgUser, $wgOut; |
205 | | - |
206 | | - # Confirm permissions |
207 | | - if ( !$this->mIsAllowedRevisionMove ) { |
208 | | - $permErrors = $this->mOldTitle->getUserPermissionsErrors( 'revisionmove', $this->user ); |
209 | | - $wgOut->showPermissionsErrorPage( $permErrors, 'revisionmove' ); |
210 | | - return false; |
211 | | - } |
212 | | - |
213 | | - # Confirm Token |
214 | | - if ( !$wgUser->matchEditToken( $this->request->getVal( 'wpEditToken' ) ) ) { |
215 | | - $wgOut->showErrorPage( 'sessionfailure-title', 'sessionfailure' ); |
216 | | - return false; |
217 | | - } |
218 | | - |
219 | | - $this->mNewTitle = Title::newFromText( $this->request->getVal( 'newTitle' ) ); |
220 | | - if ( !$this->mNewTitle instanceof Title ) { |
221 | | - $wgOut->showErrorPage( 'badtitle', 'badtitletext' ); |
222 | | - return false; |
223 | | - } |
224 | | - |
225 | | - if ( $this->mNewTitle->getPrefixedText() == $this->mOldTitle->getPrefixedText() ) { |
226 | | - $pagename = array( $this->mOldTitle->getPrefixedText() ); |
227 | | - $wgOut->showErrorPage( 'revmove-nullmove-title', 'revmove-nullmove', $pagename ); |
228 | | - return; |
229 | | - } |
230 | | - |
231 | | - $this->moveRevisions(); |
232 | | - } |
233 | | - |
234 | | - /** |
235 | | - * This function actually move the revision. NEVER call this function, call submit() |
236 | | - */ |
237 | | - protected function moveRevisions() { |
238 | | - $oldArticle = new Article( $this->mOldTitle ); |
239 | | - $newArticle = new Article( $this->mNewTitle ); |
240 | | - |
241 | | - $idstring = implode( ", ", $this->mIds ); |
242 | | - |
243 | | - # Get DB connection and begin transaction |
244 | | - $dbw = wfGetDB( DB_MASTER ); |
245 | | - $dbw->begin(); |
246 | | - |
247 | | - # Check if the target exists. If not, try creating it |
248 | | - if ( !$this->mNewTitle->exists() ) { |
249 | | - $newArticle->insertOn( $dbw ); |
250 | | - $this->createArticle = true; |
251 | | - } else { |
252 | | - $this->createArticle = false; |
253 | | - } |
254 | | - |
255 | | - # This is where the magic happens: |
256 | | - # Update revision table |
257 | | - $dbw->update( 'revision', |
258 | | - array( 'rev_page' => $this->mNewTitle->getArticleID() ), |
259 | | - array( |
260 | | - 'rev_id IN (' . $idstring . ')', |
261 | | - 'rev_page' => $this->mOldTitle->getArticleID(), |
262 | | - ), |
263 | | - __METHOD__ |
264 | | - ); |
265 | | - $modifiedRevsNum = $dbw->affectedRows(); |
266 | | - |
267 | | - # Check if we need to update page_latest |
268 | | - # Get the latest version of the revisions we are moving |
269 | | - $timestampNewPage = $this->queryLatestTimestamp( |
270 | | - $dbw, |
271 | | - $this->mNewTitle->getArticleID(), |
272 | | - array( 'rev_id IN (' . $idstring . ')' ) |
273 | | - ); |
274 | | - |
275 | | - # Compare the new page's page_latest against db query. |
276 | | - # If we create a new page, we have to update anyway |
277 | | - |
278 | | - $currentNewPageRev = Revision::newFromId( $this->mNewTitle->getLatestRevID() ); |
279 | | - if ( $this->createArticle || $timestampNewPage > $currentNewPageRev->getTimestamp() ) { |
280 | | - # we have to set page_latest to $timestampNewPage's revid |
281 | | - $this->updatePageLatest( |
282 | | - $dbw, |
283 | | - $this->mNewTitle, |
284 | | - $newArticle, |
285 | | - $timestampNewPage, |
286 | | - array( 'rev_id IN (' . $idstring . ')' ) |
287 | | - ); |
288 | | - } |
289 | | - |
290 | | - # Update the old page's page_latest field |
291 | | - $timestampOldPage = $this->queryLatestTimestamp( |
292 | | - $dbw, |
293 | | - $this->mOldTitle->getArticleID() |
294 | | - ); |
295 | | - |
296 | | - # If the timestamp is null that means the page doesn't have |
297 | | - # any revisions associated and should be deleted. In other words, |
298 | | - # someone misused revisionmove for the normal move function. |
299 | | - if ( is_null( $timestampOldPage ) ) { |
300 | | - $dbw->delete( |
301 | | - 'page', |
302 | | - array( 'page_id = ' . $this->mOldTitle->getArticleID() ), |
303 | | - __METHOD__ |
304 | | - ); |
305 | | - } else { |
306 | | - # page_latest has to be updated |
307 | | - $currentOldPageRev = Revision::newFromId( $this->mOldTitle->getLatestRevID() ); |
308 | | - if ( $timestampOldPage < $currentOldPageRev->getTimestamp() ) { |
309 | | - $this->updatePageLatest( |
310 | | - $dbw, |
311 | | - $this->mOldTitle, |
312 | | - $oldArticle, |
313 | | - $timestampOldPage |
314 | | - ); |
315 | | - } |
316 | | - # Purge the old one only if it hasn't been deleted |
317 | | - $oldArticle->doPurge(); |
318 | | - } |
319 | | - |
320 | | - # All done, commit |
321 | | - $dbw->commit(); |
322 | | - |
323 | | - $this->logMove( $modifiedRevsNum ); |
324 | | - |
325 | | - # Purge new article |
326 | | - $newArticle->doPurge(); |
327 | | - |
328 | | - # If noting went wrong (i.e. returned), we are successful |
329 | | - $this->showSuccess( $modifiedRevsNum ); |
330 | | - } |
331 | | - |
332 | | - /** |
333 | | - * Query for the latest timestamp in order to update page_latest and |
334 | | - * page_timestamp. |
335 | | - * @param &$dbw Database object (Master) |
336 | | - * @param $articleId Integer page_id |
337 | | - * @param $conds array database conditions |
338 | | - * |
339 | | - * @return String timestamp |
340 | | - */ |
341 | | - protected function queryLatestTimestamp( &$dbw, $articleId, $conds = array() ) { |
342 | | - $timestampNewRow = $dbw->selectRow( |
343 | | - 'revision', |
344 | | - 'max(rev_timestamp) as maxtime', |
345 | | - array_merge( array( 'rev_page' => $articleId ), $conds ), |
346 | | - __METHOD__ |
347 | | - ); |
348 | | - return $timestampNewRow->maxtime; |
349 | | - } |
350 | | - |
351 | | - /** |
352 | | - * Updates page_latest and similar database fields (see Article::updateRevisionOn). |
353 | | - * Called two times, for the new and the old page |
354 | | - * |
355 | | - * @param &$dbw Database object (Master) |
356 | | - * @param $articleTitle Title object of the page |
357 | | - * @param $articleObj Article object of the page |
358 | | - * @param $timestamp to search for (use queryLatestTimestamp to get the latest) |
359 | | - * @param $conds array database conditions |
360 | | - * |
361 | | - * @return boolean indicating success |
362 | | - */ |
363 | | - protected function updatePageLatest( &$dbw, $articleTitle, &$articleObj, $timestamp, $conds = array() ) { |
364 | | - # Query to find out the rev_id |
365 | | - $revisionRow = $dbw->selectRow( |
366 | | - 'revision', |
367 | | - 'rev_id', |
368 | | - array_merge( array( |
369 | | - 'rev_timestamp' => $timestamp, |
370 | | - 'rev_page' => $articleTitle->getArticleID(), |
371 | | - ), $conds ), |
372 | | - __METHOD__ |
373 | | - ); |
374 | | - |
375 | | - # Update page_latest |
376 | | - $latestRev = Revision::newFromId( $revisionRow->rev_id ); |
377 | | - return $articleObj->updateRevisionOn( $dbw, $latestRev, $articleTitle->getLatestRevID(), null, /* set new page flag */ true ); |
378 | | - } |
379 | | - |
380 | | - /** |
381 | | - * Add a log entry for the revision move |
382 | | - */ |
383 | | - protected function logMove( $modifiedRevsNum ) { |
384 | | - $paramArray = array( |
385 | | - $this->mNewTitle->getPrefixedText(), |
386 | | - $modifiedRevsNum |
387 | | - ); |
388 | | - |
389 | | - $log = new LogPage( 'move' ); |
390 | | - $log->addEntry( 'move_rev', $this->mOldTitle, $this->mReason, $paramArray, $this->user ); |
391 | | - } |
392 | | - |
393 | | - protected function showSuccess( $modifiedRevsNum ) { |
394 | | - global $wgOut; |
395 | | - |
396 | | - if ( $this->createArticle ) { |
397 | | - $wgOut->addWikiMsg( 'revmove-success-created', $modifiedRevsNum, |
398 | | - $this->mOldTitle->getPrefixedText(), $this->mNewTitle->getPrefixedText() ); |
399 | | - } else { |
400 | | - $wgOut->addWikiMsg( 'revmove-success-existing', $modifiedRevsNum, |
401 | | - $this->mOldTitle->getPrefixedText(), $this->mNewTitle->getPrefixedText() ); |
402 | | - } |
403 | | - } |
404 | | -} |
Index: branches/REL1_17/phase3/includes/SpecialPage.php |
— | — | @@ -193,7 +193,6 @@ |
194 | 194 | 'Mytalk' => 'SpecialMytalk', |
195 | 195 | 'Myuploads' => 'SpecialMyuploads', |
196 | 196 | 'Revisiondelete' => 'SpecialRevisionDelete', |
197 | | - 'RevisionMove' => 'SpecialRevisionMove', |
198 | 197 | 'Specialpages' => 'SpecialSpecialpages', |
199 | 198 | 'Userlogout' => 'SpecialUserlogout', |
200 | 199 | ); |
Index: branches/REL1_17/phase3/includes/LogPage.php |
— | — | @@ -259,7 +259,7 @@ |
260 | 260 | } |
261 | 261 | |
262 | 262 | // Page moves |
263 | | - } elseif ( $type == 'move' && count( $params ) == 3 && $action != 'move_rev' ) { |
| 263 | + } elseif ( $type == 'move' && count( $params ) == 3 ) { |
264 | 264 | if( $params[2] ) { |
265 | 265 | if ( $skin ) { |
266 | 266 | $details .= ' [' . wfMsg( 'move-redirect-suppressed' ) . ']'; |
Index: branches/REL1_17/phase3/languages/messages/MessagesEn.php |
— | — | @@ -459,7 +459,6 @@ |
460 | 460 | 'DeletedContributions' => array( 'DeletedContributions' ), |
461 | 461 | 'Tags' => array( 'Tags' ), |
462 | 462 | 'Activeusers' => array( 'ActiveUsers' ), |
463 | | - 'RevisionMove' => array( 'RevisionMove' ), |
464 | 463 | 'ComparePages' => array( 'ComparePages' ), |
465 | 464 | 'Badtitle' => array( 'Badtitle' ), |
466 | 465 | 'DisableAccount' => array( 'DisableAccount' ), |
— | — | @@ -1563,27 +1562,6 @@ |
1564 | 1563 | 'suppressionlogtext' => 'Below is a list of deletions and blocks involving content hidden from administrators. |
1565 | 1564 | See the [[Special:IPBlockList|IP block list]] for the list of currently operational bans and blocks.', |
1566 | 1565 | |
1567 | | -# Revision move |
1568 | | -'moverevlogentry' => 'moved {{PLURAL:$3|one revision|$3 revisions}} from $1 to $2', |
1569 | | -'revisionmove' => 'Move revisions from "$1"', |
1570 | | -'revisionmove-backlink' => '← $1', # only translate this message to other languages if you have to change it |
1571 | | -'revmove-explain' => 'The following revisions will be moved from $1 to the specified target page. If the target does not exist, it is created. Otherwise, these revisions will be merged into the page history.', |
1572 | | -'revmove-legend' => 'Set target page and summary', |
1573 | | -'revmove-submit' => 'Move revisions to selected page', |
1574 | | -'revisionmoveselectedversions' => 'Move selected revisions', |
1575 | | -'revmove-reasonfield' => 'Reason:', |
1576 | | -'revmove-titlefield' => 'Target page:', |
1577 | | -'revmove-badparam-title' => 'Bad parameters', |
1578 | | -'revmove-badparam' => 'Your request contains illegal or insufficient parameters. |
1579 | | -Go back to the previous page and try again.', |
1580 | | -'revmove-norevisions-title' => 'Invalid target revision', |
1581 | | -'revmove-norevisions' => 'You have not specified one or more target revisions to perform this function or the specified revision does not exist.', |
1582 | | -'revmove-nullmove-title' => 'Bad title', |
1583 | | -'revmove-nullmove' => 'The target page cannot be the same as the source page. |
1584 | | -Go back to the previous page and choose a different name from "$1".', |
1585 | | -'revmove-success-existing' => '{{PLURAL:$1|One revision from [[$2]] has|$1 revisions from [[$2]] have}} been moved to the existing page [[$3]].', |
1586 | | -'revmove-success-created' => '{{PLURAL:$1|One revision from [[$2]] has|$1 revisions from [[$2]] have}} been moved to the newly created page [[$3]].', |
1587 | | - |
1588 | 1566 | # History merging |
1589 | 1567 | 'mergehistory' => 'Merge page histories', |
1590 | 1568 | 'mergehistory-header' => 'This page lets you merge revisions of the history of one source page into a newer page. |
— | — | @@ -1953,7 +1931,6 @@ |
1954 | 1932 | 'right-reset-passwords' => "Reset other users' passwords", |
1955 | 1933 | 'right-override-export-depth' => 'Export pages including linked pages up to a depth of 5', |
1956 | 1934 | 'right-sendemail' => 'Send e-mail to other users', |
1957 | | -'right-revisionmove' => 'Move revisions', |
1958 | 1935 | 'right-disableaccount' => 'Disable accounts', |
1959 | 1936 | |
1960 | 1937 | # User rights log |
— | — | @@ -1997,7 +1974,6 @@ |
1998 | 1975 | 'action-userrights' => 'edit all user rights', |
1999 | 1976 | 'action-userrights-interwiki' => 'edit user rights of users on other wikis', |
2000 | 1977 | 'action-siteadmin' => 'lock or unlock the database', |
2001 | | -'action-revisionmove' => 'move revisions', |
2002 | 1978 | |
2003 | 1979 | # Recent changes |
2004 | 1980 | 'nchanges' => '$1 {{PLURAL:$1|change|changes}}', |
Index: branches/REL1_17/phase3/RELEASE-NOTES |
— | — | @@ -139,9 +139,6 @@ |
140 | 140 | notified about the beginning and finishing of LivePreview actions. |
141 | 141 | * (bug 21278) Now the sidebar allows inclusion of wiki markup. |
142 | 142 | * (bug 23733) Add IDs to messages used on CSS/JS pages |
143 | | -* (bug 21312) RevisionMove allows moving individual revisions of a page to |
144 | | - another page. Introducing 'revisionmove' user right; disabled by default; |
145 | | - experimental feature. |
146 | 143 | * Show validity period of the login cookie in Special:UserLogin and |
147 | 144 | Special:Preferences |
148 | 145 | * Interlanguage links display the page title in their tooltip. |