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

<?php
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

<?php
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:

<?php
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.

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.

hotsaucedesign’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.

hotsaucedesign’s picture

Issue summary:View changes
Status:Active» Patch (to be ported)