Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
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
| This issue has a non-specific relationship to: | ||||
| MDL-19342 | We can not search by search keyword which include multi-byte strings in Globa search. |
|
|
|
I'm searching the final use of the $resultdoc->user_id .... I would prefer to name the var userid for consistance.