Moodle

Adding filed 'user_id' at document.php, but it does not return by process_results()

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.5
  • Fix Version/s: None
  • Component/s: Global search
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

We can use to get user-image file (function print_user_picture(), lib/weblib.php) by using user_id.
The API for storing the parameter 'user_id' is prepared insearch/documents/document.php;

$this->addField(Zend_Search_Lucene_Field::Keyword('user_id', $user_id));

On the other hand, function process_results() in search/querylib.php does not return user_id.

Patch is as follows;

if ($i >= ($page - 1) * $this->results_per_page){
$resultdoc->number = $realindex;
$resultdoc->url = $hit->url;
$resultdoc->title = $hit->title;
$resultdoc->score = $hit->score;
$resultdoc->doctype = $hit->doctype;
$resultdoc->author = $hit->author;
$resultdoc->courseid = $hit->course_id;
// (Shirai143): Add from here
$resultdoc->user_id = $hit->user_id;
// (Shirai143): Add to here


user_id is very useful parameter!

Issue Links

Activity

Hide
Valery Fremaux added a comment -

I'm searching the final use of the $resultdoc->user_id .... I would prefer to name the var userid for consistance.

Show
Valery Fremaux added a comment - I'm searching the final use of the $resultdoc->user_id .... I would prefer to name the var userid for consistance.
Hide
Valery Fremaux added a comment -

found in your patch in query.php

Everything OK.

Show
Valery Fremaux added a comment - found in your patch in query.php Everything OK.
Hide
Tatsuya Shirai added a comment -

I think that this issue are resolved by valery, Everytihing OK.

Show
Tatsuya Shirai added a comment - I think that this issue are resolved by valery, Everytihing OK.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: