Issue Details (XML | Word | Printable)

Key: MDL-19705
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Valery Fremaux
Reporter: Tatsuya Shirai
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Parameters for calling constructor of UserSearchDocument and UserPostSearchDocument in function user_single_document() is not right.

Created: 03/Jul/09 09:16 AM   Updated: 03/Jul/09 09:16 AM
Return to search
Component/s: Global search
Affects Version/s: 1.9.5
Fix Version/s: None

Participants: Tatsuya Shirai and Valery Fremaux
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
Prototype declarations are there:

class UserSearchDocument extends SearchDocument {
(1) public function __construct(&$userhash, $user_id, $context_id) {
class UserPostSearchDocument extends SearchDocument {
(2) public function __construct(&$post, $user_id, $context_id) {

In function user_single_document(), these constructors are called as follows:
(1) return new UserSearchDocument($userhash, $user->id, 'user', null);
(2) return new UserPostSearchDocument($posthash, $post->userid, 'post', null);

To match call with prototype, we need to change as follows:
(1) return new UserSearchDocument($userhash, $user->id, null);
(2) return new UserPostSearchDocument($posthash, $post->userid, null);

------------------
Original code about (2) was,
(2) return new UserPostSearchDocument($posthash, $user->id, 'post', null);
but we also need to change $user->id to $post->id, since we does not know userid directly from $user->id when itemtype equals 'post'.


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.