0

I have a view that seeks to find users that have not filled in a form on the site which is a personal profile. It works correctly for admin user, but not for other user roles although the permissions have been set to allow this.

The view is a view of users and uses a relationship to their authored content.

The full view code is:

$view = new view();
$view->name = 'mentees_without_profiles_';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'users';
$view->human_name = 'Mentees without profiles ';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Mentees without profiles ';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
  3 => '3',
  6 => '6',
);
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'table';
/* Relationship: User: Content authored */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'users';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
/* Field: User: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'users';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['label'] = 'User Name';
$handler->display->display_options['fields']['name']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
/* Field: User: E-mail */
$handler->display->display_options['fields']['mail']['id'] = 'mail';
$handler->display->display_options['fields']['mail']['table'] = 'users';
$handler->display->display_options['fields']['mail']['field'] = 'mail';
$handler->display->display_options['fields']['mail']['element_label_colon'] = FALSE;
/* Sort criterion: User: E-mail */
$handler->display->display_options['sorts']['mail']['id'] = 'mail';
$handler->display->display_options['sorts']['mail']['table'] = 'users';
$handler->display->display_options['sorts']['mail']['field'] = 'mail';
/* Filter criterion: User: Active */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'users';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '1';
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: User: Roles */
$handler->display->display_options['filters']['rid']['id'] = 'rid';
$handler->display->display_options['filters']['rid']['table'] = 'users_roles';
$handler->display->display_options['filters']['rid']['field'] = 'rid';
$handler->display->display_options['filters']['rid']['value'] = array(
  4 => '4',
);
/* Filter criterion: Content: Title */
$handler->display->display_options['filters']['title']['id'] = 'title';
$handler->display->display_options['filters']['title']['table'] = 'node';
$handler->display->display_options['filters']['title']['field'] = 'title';
$handler->display->display_options['filters']['title']['relationship'] = 'uid';
$handler->display->display_options['filters']['title']['operator'] = 'empty';

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'mentees-without-profiles';
$translatables['mentees_without_profiles_'] = array(
  t('Master'),
  t('Mentees without profiles '),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('nodes'),
  t('User Name'),
  t('E-mail'),
  t('Page'),
);
  • 1
    where did you set the permission for your view ? – shrish Jun 12 '14 at 10:19
2

Check whether those users have the permission to view other user profile.

I am posting this as an answer instead of comment because I don't have enough reputation to add comment, so don't down vote it.

| improve this answer | |
0

Even if you set the permission for view correctly, the problem won't be solved. There is a problem with the that relationship: "User: Content authored". Only admin can view the results. Issue submitted here

One solution recommended is to use Views Field View to create a view (name it form_values_view for example) that get the form values required then add a views field inside your view mentees_without_profiles_ that read the values of view form_values_view.

you can also use module Views PHP filter and write your own handler

Another solution is to use Views Api to add your custom filter handler or use hook_views_query_alter() and join your form tables then filter the view result

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.