Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
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
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'.
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