Hi,
i have problem with Activity and User Relationships.
I can't see my friends activity in block and in Activity Menu - My friends Activity. But i could see it in All activity.

user A add user B like as a friend.
both make some activity.
But user A dont see user B activity.
User B see User A activity allright.

Do you have any idea, where could be problem?

Thanks

Tom

Comments

dalad’s picture

I think the problem is in the function user_relationshipsactivity_user_relationships of user_userrelationshipsactivity.module
Fact is that:
1) When a relationship is approved, $op is "presave" but the switch tries to catch "post-save"
2) When a relationship is deleted, $op is "remove" and $category is null but the switch tries to catch $op="delete" and $category="remove"

I resolved with this edit, which is a hack, not a patch:

  $category = ($category == "") ? $op : $category;
  switch ($op) {
//'ops' => array('requested' => t('Requested'), 'approved' => t('Approved'), 'denied' => t('Denied'), 'canceled' => t('Canceled'), 'deleted' => t('Deleted')),
    case 'post-save':
    case 'presave':
      if ($relationship->approved) {
        $operation = 'approved';
        $target_users_roles[ACTIVITY_ALL] = 'all';
      }
      else {
        $operation = 'requested';
      }
    break;

    case 'delete':
    case 'remove':
      switch ($category) {
        case 'remove':
          $operation = 'deleted';
          $target_users_roles[ACTIVITY_ALL] = 'all';
        break;

        case 'cancel':
          $operation = 'canceled';
        break;

        case 'disapprove':
          $operation = 'denied';
        break;
      }
    break;

  }

Still there is an issue with "who has requested to who" sentence in activity list...

Rosamunda’s picture

subscribing

jaydub’s picture

The user_relationships hook changed from UR 5.2 to UR 6.1

I've reworked the hook implementation to work correctly with both versions and will commit to CVS shortly.

sirkitree’s picture

Issue tags: +activity-6.x-1-0-rc1

tagging to be fixed by the rc

sirkitree’s picture

Status: Active » Postponed (maintainer needs more info)

Have you committed anything to CVS for this since you mentioned having code for it?

jaydub’s picture

yes the last commit on Jan 1 had a lot of the changes referred to here:

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/activity/co...

sirkitree’s picture

ok, so... is there anything left to do?

jaydub’s picture

Well the original poster can check to see if their problem still occurs. Each contrib module basically just needs to have the tires kicked to see if the basic activity records and blocks show the expected information.

sirkitree’s picture

Status: Postponed (maintainer needs more info) » Fixed

No negative feedback from users.

Status: Fixed » Closed (fixed)
Issue tags: -activity-6.x-1-0-rc1

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