Download & Extend

Fatal error: Call to undefined function flag_friend_determine_friend_status()

Project:CCK Private Fields
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

complete error

Fatal error: Call to undefined function flag_friend_determine_friend_status() in /foobar/all/modules/contrib/cck_private_fields/modules/cck_private_fields_flag_friend/cck_private_fields_flag_friend.module on line 16

Comments

#1

Code to fix the error, insert in the file "cck_private_fields_flag_friend.module":

/**
* Implementation of hook_cck_private_fields_view_access().
*/
function cck_private_fields_flag_friend_cck_private_fields_view_access($field, $node, $account) {
  $friend_flag = flag_get_flag('friend');
  if ($friend_flag) {
    // Grant access if both users are friends.
    // Work with flag friend API 2.
    $flag_friend_api = flag_friend_views_api();
    if ($flag_friend_api['api'] == 2) {
      $friend_status = flag_friend_relationship_status($friend_flag, $node->uid, $account->uid);
    }
    else {
      $friend_status = flag_friend_determine_friend_status($friend_flag, $node->uid, $account->uid);
    }
    return ($friend_status == FLAG_FRIEND_FLAGGED ? TRUE : FALSE);
  }

  // If no friendship status is available, deny access for privacy reasons.
  return FALSE;
}

#2

Category:bug report» feature request
Priority:critical» normal
Status:active» needs work

AFAICT, this issue is related to a change in Flag Friend, maybe newer versions have changed, so this is not strictly a bug, IMHO, but a feature request to offer support for newer versions of Flag Friend.

Could the above changed be supplied in patch form, please? It should help others test the code, and validate if it works ok. Thanks

#3

maybe newer versions have changed, so this is not strictly a bug ..

Yes, but are exist peoples work with Flag Friend module dev version. The dev version include the upcomming Flag Friend version 2. In this context is it an bug.

Bug fix patch are attached.

AttachmentSize
cck_private_fields.module.patch 973 bytes

#4

Wow, the guys from the Flag Friend module to do funny things.

What is fact?

Flag friend module 6.x-1.0-rc4, this is module version 1, produce this error:

Call to undefined function flag_friend_relationship_status() in ...

What is the funny thing?

It is required a function of the Flag Friend module version 2.

Solution

As quick fix you can insert the following code in the flag_friend.module:

function flag_friend_relationship_status($friend_flag, $uid1, $uid2) {
  return flag_friend_determine_friend_status($flag, $uid1, $uid2, $reset = NULL);
}

#5

Category:feature request» bug report
Status:needs work» fixed

Ok, I just committed a slight variation of the fix. We now check for the function name and use the one that exists.

http://drupal.org/cvs?commit=383536

Thanks!

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#7

Status:closed (fixed)» active

The guys from Flag Friend module still have not done anything to fix the problem. Take a look at this post: Fatal error: Call to undefined function flag_friend_relationship_status()

Dear CCK Private Fields maintainer, you are obviously not been consistent enough, to force the solution of the problem. Please help and force the solution. The time has come.

Thanks

#8

Status:active» postponed (maintainer needs more info)

Not really sure what you mean. The CCK Private Fields module has been modified to invoke the old or the new function from Flag Friend module. Which error are you getting now exactly?

#9

Hi, just wanted to note that I've marked our issue as won't fix. You don't see drupal 5 supporting drupal 6 functions, it would be willy for flag friend 1.x to support 2.x functions, especially when 2.x is still in -dev.

The solution committed here should be sufficient.

nobody click here