Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | action_block_not_showing_up_on_other_userpages-1887422-1.patch | 1.06 KB | criz |
Comments
Comment #1
crizbug 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.
Comment #2
hot_sauce CreditAttribution: hot_sauce commentedThank 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.
Comment #3
hot_sauce CreditAttribution: hot_sauce commentedComment #4
cmseasy CreditAttribution: cmseasy commentedPatch #1 works also for alpha 6 and dev (dec 2017)