From c692370fe2b133a8820ad87715a0d814c250d1fa Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 29 Oct 2010 17:26:22 +0000 Subject: [PATCH] (bug 22308) Search should find text in default main page immediately after setup. Based on patch by Josh Lerner --- RELEASE-NOTES | 1 + includes/installer/CoreInstaller.php | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2a38a1dd0b..6cd1e50641 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -372,6 +372,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN $wgGroupPermissions now appear on Special:ListGroupRights * (bug 23923) Special:Prefixindex no longer shows results if nothing was requested. +* (bug 22308) Search now finds text in default main page immediately after setup === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent. diff --git a/includes/installer/CoreInstaller.php b/includes/installer/CoreInstaller.php index ca10131c35..436dc27840 100644 --- a/includes/installer/CoreInstaller.php +++ b/includes/installer/CoreInstaller.php @@ -444,12 +444,13 @@ abstract class CoreInstaller extends Installer { try { $titleobj = Title::newFromText( wfMsgForContent( "mainpage" ) ); $article = new Article( $titleobj ); - $article->doEdit( wfMsgForContent( 'mainpagetext' ) . "\n\n" . - wfMsgForContent( 'mainpagedocfooter' ), - '', - EDIT_NEW, - false, - User::newFromName( 'MediaWiki Default' ) ); + $text = wfMsgForContent( 'mainpagetext' ) . "\n\n" . + wfMsgForContent( 'mainpagedocfooter' ); + $article->doEdit( $text, '', EDIT_NEW, false, + User::newFromName( 'MediaWiki Default' ) ); + $u = new SearchUpdate( $titleobj->getArticleID(), + $titleobj->getPrefixedDBkey(), $text ); + $u->doUpdate(); } catch (MWException $e) { //using raw, because $wgShowExceptionDetails can not be set yet $status->fatal( 'config-install-mainpage-failed', $e->getMessage() ); -- 2.20.1