Skip to content

Commit

Permalink
global search MDL-25133 fixes to blog posts search documents so that …
Browse files Browse the repository at this point in the history
…it will add new posts into the search index successfully
  • Loading branch information
nebgor committed Nov 11, 2010
1 parent 0ed26d1 commit f38da03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions search/documents/user_document.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))){
Expand Down

0 comments on commit f38da03

Please sign in to comment.