Page MenuHomePhabricator

Search index improperly updated on page move
Closed, ResolvedPublic

Description

Title::moveTo()'s search index updates are bogus at the moment; it's using
uninitialized page id vars. Should be easy to fix, but don't forget.


Version: 1.5.x
Severity: normal

Details

Reference
bz2275

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:32 PM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz2275.
bzimport added a subscriber: Unknown Object (MLST).

dbenbenn wrote:

patch to initialize those variables

Later in the same function, the calls to

new SearchUpdate( $oldid, $nt->getPrefixedDBkey() );

and

new SearchUpdate( $newid, $this->getPrefixedDBkey(), '' );

look backwards. Why is the new article title ($nt) used with the old ID?

Attached:

The variable names were poorly chosen which made this more confusing than it should be. :)
I've changed them to $pageid and $redirid, and moved the getArticleId()s around so it
picks up the right values.

When a page is renamed, its page_id stays constant while its page_namespace and page_title
fields change. A new page is created which redirects to it; this new page carries the old
page_namespace and page_title values, but has a different page_id.