Hi guys,

The actions block can not be displayed on other peoples user pages (like user/123). I solved it (but not tested it) by changing the following code on user_rlationship_blocks.module function user_relationship_blocks_block_view($delta) from

else if ($uid = _user_relationship_blocks_get_uid($delta)) {
    $account_loaded = user_load($uid);
     if ($account_loaded && user_relationships_ui_check_access('view', $account_loaded, user_relationships_type_load($rtid))) {
      $account = $account_loaded;
    }
  }

to

else if ($uid = _user_relationship_blocks_get_uid($delta)) {
    $account_loaded = user_load($uid);
    if ($delta == "actions" && $account_loaded && user_relationships_ui_check_access('request', $user)) {
      $account = $account_loaded;
    } else if ($account_loaded && user_relationships_ui_check_access('view', $account_loaded, user_relationships_type_load($rtid))) {
      $account = $account_loaded;
    }
  }

and implementing the hook_user_relationship_blocks_get_uid in:

function YOURMODULE_user_relationship_blocks_get_uid($delta) {
  if (arg(0) == 'user') {
    if(intval(arg(1)) == arg(1) && arg(2) == null) { return arg(1);}
  }
}

But to be honest, it should have a better more thought through solution... If you want to enable actions block, you off course want those actions to happen especially on other users profile pages. Especially when you have overriden the default user page with a view.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

criz’s picture

bug confirmed. this patch is my fast fix. don't tried above code.

otherwise the actions block is only showing up when the permission "view all @relationship relationships" is set.

hot_sauce’s picture

Thank you criz for this, that was just what I needed because I had the same issue. Will post the link to this thread in some of the other duplicate issues.

hot_sauce’s picture

Issue summary: View changes
Status: Active » Patch (to be ported)
cmseasy’s picture

Version: 7.x-1.0-alpha4 » 7.x-1.0-alpha6

Patch #1 works also for alpha 6 and dev (dec 2017)