Ticket #257 (new defect)

Opened 8 months ago

Last modified 7 months ago

Undefined isfriend function in mod/commentwall/lib.php (v. 0.9)

Reported by: svickers Assigned to: misja
Priority: normal Milestone: 0.9.2
Component: core Version: 0.9.0
Severity: normal Keywords:
Cc: Patch Included: 0
Review Stage: accepted

Description

The code for version 0.9 in mod/commentwall/lib.php references an undefined function called isfriend(). The following code may represent an appropriate solution:

function isfriend($userid,$ownerid)
{
global $CFG;

if (isloggedin()) {
if ($userid == $ownerid || user_flag_get('admin',$userid)) {
return true;
}
if (record_exists('friends','owner',$userid,'friend',$ownerid)) {
return true;
}
}

return false;
}

Change History

01/25/08 18:55:14 changed by ewout

  • haspatch changed.
  • review_stage set to accepted.

Ha! there is also a non-existent "FRIENDS_ONLY" access restriction. Assigning this to Misja, since he probably can contact the original authors easily.

02/02/08 23:13:02 changed by davenewman

When you select FRIENDS_ONLY for the commentwall for a community, this bug causes every community page to disappear - you just see a blank page.

02/14/08 15:04:01 changed by misja

isfriend() added in r1553

02/15/08 08:25:05 changed by misja

  • milestone changed from 0.9.1 to 0.9.2.

FRIENDS_ONLY needs checking, defer to 0.9.2