From f38da0342f3f800706815f1440e9b18d223d1c48 Mon Sep 17 00:00:00 2001 From: Aparup Banerjee Date: Thu, 11 Nov 2010 05:53:43 +0000 Subject: [PATCH] global search MDL-25133 fixes to blog posts search documents so that it will add new posts into the search index successfully --- search/documents/user_document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search/documents/user_document.php b/search/documents/user_document.php index bd0abc6540c..418193e798f 100644 --- a/search/documents/user_document.php +++ b/search/documents/user_document.php @@ -284,14 +284,14 @@ function user_single_document($id, $itemtype) { return new UserSearchDocument($userhash, $user->id, 'user', null); } } elseif ($itemtype == 'post') { - if ($post = $DB->get_records('post', array('id' => $id))){ + if ($post = $DB->get_record('post', array('id' => $id))){ $texts = array(); $texts[] = $post->subject; $texts[] = $post->summary; $texts[] = $post->content; $post->description = implode(" ", $texts); $posthash = get_object_vars($post); - return new UserPostSearchDocument($posthash, $user->id, 'post', null); + return new UserPostSearchDocument($posthash, $post->userid, 'post', null); } } elseif ($itemtype == 'attachment' && @$CFG->block_search_enable_file_indexing) { if ($post = $DB->get_records('post', array('id' => $id))){