From: Brion Vibber Date: Tue, 27 Jun 2006 19:07:24 +0000 (+0000) Subject: * (bug 2483) Run link updates on change via XML import X-Git-Tag: 1.31.0-rc.0~56571 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=1f4bd844c846e0e96722c1f550ae6804d3771c3a;p=lhc%2Fweb%2Fwiklou.git * (bug 2483) Run link updates on change via XML import --- 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; }