Seems silly to have hook_activity_info and hook_activity_access_info(). This patch unifies them into hook_activity_info()

CommentFileSizeAuthor
activity_unify.patch7.33 KBScott Reynolds

Comments

Scott Reynolds’s picture

This will break flag_friend. To fix do this:

/**
 * Implementation of hook_activity_info().
 */
function flag_friend_activity_info() {
  flag = flag_get_flag('friend');
  $info = new stdClass();
  $info->api = 2;
  $info->name = 'flag_friend';
  $info->object_type = 'flag_friend';
  $info->objects = array('requestor' => 'user', 'requestee' => 'flag_friend'); // array keys are the labels
  $info->hooks = array('flag_friend' => array('approve', 'request', 'deny', 'remove'));
  $info->realms = array('flag_friend' => $flag->title);
  return $info;
}
Scott Reynolds’s picture

Status: Needs review » Fixed
Scott Reynolds’s picture

Project: Activity » Flag Friend
Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Fixed » Needs review

update flag friend with that change ^^ and remove hook_activity_access_api().

Scott Reynolds’s picture

Title: Unify Access api and recording api » Remove flag_friend_activity_access_api() and extend flag_friend_activity_info()
sirkitree’s picture

Status: Needs review » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)

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