From 1f4bd844c846e0e96722c1f550ae6804d3771c3a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 27 Jun 2006 19:07:24 +0000 Subject: [PATCH] * (bug 2483) Run link updates on change via XML import --- RELEASE-NOTES | 1 + includes/SpecialImport.php | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 440687e58c..21053b67bc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -573,6 +573,7 @@ Some default configuration options have changed: * (bug 672) Add MathAfterTexvc hook * Update to Piedmontese localization (pms) * dumpBackup can optionally compress via dbzip2 +* (bug 2483) Run link updates on change via XML import == Compatibility == diff --git a/includes/SpecialImport.php b/includes/SpecialImport.php index 07ba40a415..37d6e5de79 100644 --- a/includes/SpecialImport.php +++ b/includes/SpecialImport.php @@ -211,6 +211,9 @@ class WikiRevision { if( $pageId == 0 ) { # must create the page... $pageId = $article->insertOn( $dbw ); + $created = true; + } else { + $created = false; } # FIXME: Check for exact conflicts @@ -232,8 +235,27 @@ class WikiRevision { 'minor_edit' => $this->minor, ) ); $revId = $revision->insertOn( $dbw ); - $article->updateIfNewerOn( $dbw, $revision ); + $changed = $article->updateIfNewerOn( $dbw, $revision ); + if( $created ) { + wfDebug( __METHOD__ . ": running onArticleCreate\n" ); + Article::onArticleCreate( $this->title ); + } else { + if( $changed ) { + wfDebug( __METHOD__ . ": running onArticleEdit\n" ); + Article::onArticleEdit( $this->title ); + } + } + if( $created || $changed ) { + wfDebug( __METHOD__ . ": running edit updates\n" ); + $article->editUpdates( + $this->getText(), + $this->getComment(), + $this->minor, + $this->timestamp, + $revId ); + } + return true; } -- 2.20.1