* (bug 7510) Update article counts etc on undelete
This commit is contained in:
parent
6692440663
commit
0db46cb706
3 changed files with 21 additions and 10 deletions
|
|
@ -275,6 +275,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
|
|||
* Made messages used in Special:Preferences either plain text or wikitext (toggles)
|
||||
* Replaced {{SERVER}}{{localurl:xxx}} with {{fullurl:xxx}} in localisation files
|
||||
* Fix regression in Special:Watchlist text header
|
||||
* (bug 7510) Update article counts etc on undelete
|
||||
|
||||
|
||||
== Languages updated ==
|
||||
|
|
|
|||
|
|
@ -2161,6 +2161,22 @@ class Article {
|
|||
|
||||
wfProfileOut( __METHOD__ );
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform article updates on a special page creation.
|
||||
*
|
||||
* @param Revision $rev
|
||||
*
|
||||
* @fixme This is a shitty interface function. Kill it and replace the
|
||||
* other shitty functions like editUpdates and such so it's not needed
|
||||
* anymore.
|
||||
*/
|
||||
function createUpdates( $rev ) {
|
||||
$this->mGoodAdjustment = $this->isCountable( $rev->getText() );
|
||||
$this->mTotalAdjustment = 1;
|
||||
$this->editUpdates( $rev->getText(), $rev->getComment(),
|
||||
$rev->isMinor(), wfTimestamp(), $rev->getId(), true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the navigation links when browsing through an article revisions
|
||||
|
|
|
|||
|
|
@ -350,17 +350,11 @@ class PageArchive {
|
|||
if( $revision ) {
|
||||
# FIXME: Update latest if newer as well...
|
||||
if( $newid ) {
|
||||
# FIXME: update article count if changed...
|
||||
// Attach the latest revision to the page...
|
||||
$article->updateRevisionOn( $dbw, $revision, $previousRevId );
|
||||
|
||||
# Finally, clean up the link tables
|
||||
$options = new ParserOptions;
|
||||
$parserOutput = $wgParser->parse( $revision->getText(), $this->title, $options,
|
||||
true, true, $newRevId );
|
||||
$u = new LinksUpdate( $this->title, $parserOutput );
|
||||
$u->doUpdate();
|
||||
|
||||
#TODO: SearchUpdate, etc.
|
||||
|
||||
// Update site stats, link tables, etc
|
||||
$article->createUpdates( $revision );
|
||||
}
|
||||
|
||||
if( $newid ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue