I've been trying to customize this view a bit to include an add/remove link in the view, but when I use the Actionlink field, the link field is populated with the 'Add buddy' link, and the UID the link tries to refer to is 0(zero). Is there a problem with how I'm trying to implement this view?
here's an export of it.
$view = new stdClass();
$view->name = 'buddy_api_my_buddylist';
$view->description = 'list of my buddies (for block use - shows everytime the buddies of the logged user)';
$view->access = array (
);
$view->view_args_php = '';
$view->page = FALSE;
$view->page_title = '';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'table';
$view->url = '';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->block = TRUE;
$view->block_title = 'My Buddylist';
$view->block_header = '';
$view->block_header_format = '1';
$view->block_footer = '';
$view->block_footer_format = '1';
$view->block_empty = '';
$view->block_empty_format = '1';
$view->block_type = 'table';
$view->nodes_per_block = '10';
$view->block_more = TRUE;
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array (
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'users',
'field' => 'name',
'label' => 'Name',
),
array (
'tablename' => 'baj_node_buddylist_users',
'field' => 'buddy_actionlink',
'label' => 'Ops',
'handler' => 'buddy_api_views_handler_action_link',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'usernode',
),
),
array (
'tablename' => 'baj_node_buddylist_users',
'field' => 'currentid',
'operator' => '=',
'options' => '',
'value' => '***CURRENT_USER***',
),
);
$view->exposed_filter = array (
);
$view->requires = array(users, baj_node_buddylist_users, node);
$views[$view->name] = $view;
Comments
Comment #1
liliplanet commentedHi,
Having the same problem and have been struggling for days. Did you perhaps find the solution? If you did, please export your view :)
Look forward to your results, and thank you.
Lilian
Comment #2
liliplanet commentedIs there perhaps a solution for this? If Buddylist and Buddylist2 are deleted (which I've done maybe 20 times) what are the best options to make this work?
Do we install Buddylist (1) first, disable, then install Buddylist2? Believe, have tried absolutely everything .. even Buddylist 2 on it's own and still 'add to your buddylist' when the users are already buddies.
Please help ..
Lilian
Comment #3
smitty commentedThere seems to be a little bug in function buddy_api_views_handler_action_link in file buddy_api.views.inc:
Please change line 290 of this file from
$viewed = user_load(array('uid' => $data->usernode_users_uid));to
$viewed = user_load(array('uid' => $data->users_uid));Afterwards ist should work correctly.
Comment #4
nodestroy commentedHi,
thanks for that, i fixed this in head, there will be a beta3 release soon
regards