* (bug 2275) Update search index more or less right on page move
This commit is contained in:
parent
0207abde02
commit
a1fb3b5306
4 changed files with 11 additions and 8 deletions
|
|
@ -232,6 +232,7 @@ Various bugfixes, small features, and a few experimental things:
|
|||
that does both numeric and named chars: Sanitizer::decodeCharReferences
|
||||
* Removed some obsolete UTF-8 converter functions
|
||||
* Fix function comment in debug dump of SQL statements
|
||||
* (bug 2275) Update search index more or less right on page move
|
||||
|
||||
|
||||
=== Caveats ===
|
||||
|
|
|
|||
|
|
@ -303,8 +303,8 @@ $text: text of the mail
|
|||
$old: old title
|
||||
$nt: new title
|
||||
$user: user who did the move
|
||||
$oldid: old article database ID
|
||||
$newid: new article database ID
|
||||
$pageid: database ID of the page that's been moved
|
||||
$redirid: database ID of the created redirect
|
||||
|
||||
'UnknownAction': An unknown "action" has occured (useful for defining
|
||||
your own actions)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class SearchUpdate {
|
|||
$search =& SearchEngine::create();
|
||||
$lc = $search->legalSearchChars() . '&#;';
|
||||
|
||||
if( $this->mText == false ) {
|
||||
if( $this->mText === false ) {
|
||||
$search->updateTitle($this->mId,
|
||||
Title::indexTitle( $this->mNamespace, $this->mTitle ));
|
||||
wfProfileOut( $fname );
|
||||
|
|
|
|||
|
|
@ -1532,18 +1532,20 @@ class Title {
|
|||
if( is_string( $err ) ) {
|
||||
return $err;
|
||||
}
|
||||
|
||||
$pageid = $this->getArticleID();
|
||||
if( $nt->exists() ) {
|
||||
$this->moveOverExistingRedirect( $nt, $reason );
|
||||
} else { # Target didn't exist, do normal move.
|
||||
$this->moveToNewTitle( $nt, $newid, $reason );
|
||||
}
|
||||
$redirid = $this->getArticleID();
|
||||
|
||||
# Fixing category links (those without piped 'alternate' names) to be sorted under the new title
|
||||
|
||||
$dbw =& wfGetDB( DB_MASTER );
|
||||
$categorylinks = $dbw->tableName( 'categorylinks' );
|
||||
$sql = "UPDATE $categorylinks SET cl_sortkey=" . $dbw->addQuotes( $nt->getPrefixedText() ) .
|
||||
" WHERE cl_from=" . $dbw->addQuotes( $this->getArticleID() ) .
|
||||
" WHERE cl_from=" . $dbw->addQuotes( $pageid ) .
|
||||
" AND cl_sortkey=" . $dbw->addQuotes( $this->getPrefixedText() );
|
||||
$dbw->query( $sql, 'SpecialMovepage::doSubmit' );
|
||||
|
||||
|
|
@ -1559,12 +1561,12 @@ class Title {
|
|||
}
|
||||
|
||||
# Update search engine
|
||||
$u = new SearchUpdate( $oldid, $nt->getPrefixedDBkey() );
|
||||
$u = new SearchUpdate( $pageid, $nt->getPrefixedDBkey() );
|
||||
$u->doUpdate();
|
||||
$u = new SearchUpdate( $newid, $this->getPrefixedDBkey(), '' );
|
||||
$u = new SearchUpdate( $redirid, $this->getPrefixedDBkey(), '' );
|
||||
$u->doUpdate();
|
||||
|
||||
wfRunHooks( 'TitleMoveComplete', array(&$this, &$nt, &$wgUser, $oldid, $newid) );
|
||||
wfRunHooks( 'TitleMoveComplete', array( &$this, &$nt, &$wgUser, $pageid, $redirid ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue