1

I created a view to replace the default view of the members page of the "Group" module. When I am a site administrator the mass operation works.

When I am an authenticated user (No administrator of the site) and I select members to block them with mass operation, members are still active and the following error appears in the log (see screenshot).

When I disable my view and use the module's default view. Everything works fine.

enter image description here enter image description here

Here is the export of my view :

$view = new view();
$view->name = 'group_members';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'group_membership';
$view->human_name = 'Membres';
$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'] = 'Liste des membres';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['use_more_text'] = 'plus';
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
  3 => '3',
  9 => '9',
);
$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['exposed_form']['options']['submit_button'] = 'Appliquer';
$handler->display->display_options['exposed_form']['options']['reset_button_label'] = 'Réinitialiser';
$handler->display->display_options['exposed_form']['options']['exposed_sorts_label'] = 'Trier par';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'table';
/* Entête: Global : Texte non filtré */
$handler->display->display_options['header']['area_text_custom']['id'] = 'area_text_custom';
$handler->display->display_options['header']['area_text_custom']['table'] = 'views';
$handler->display->display_options['header']['area_text_custom']['field'] = 'area_text_custom';
$handler->display->display_options['header']['area_text_custom']['empty'] = TRUE;
$handler->display->display_options['header']['area_text_custom']['content'] = '<strong>Légende :</strong></br>
Actif = fait partie du groupe et a accès aux offres groupées.</br>
Bloqué = fait partie du groupe mais n\'a plus accès aux offres groupées.</br>
Invité = a été invité dans le groupe mais n\'a pas encore accepté l\'invitation.';
/* Pied de page: Global : Texte non filtré */
$handler->display->display_options['footer']['area_text_custom']['id'] = 'area_text_custom';
$handler->display->display_options['footer']['area_text_custom']['table'] = 'views';
$handler->display->display_options['footer']['area_text_custom']['field'] = 'area_text_custom';
$handler->display->display_options['footer']['area_text_custom']['empty'] = TRUE;
$handler->display->display_options['footer']['area_text_custom']['content'] = '<strong>Instructions :</strong></br>
<u>Pour démarrer une commande groupée :</u></br>
Étape 1 : mettre à jour la liste des membres.</br>
Étape 2 : aller sur la page du groupe et cliquer sur "Démarrer la vente".</br>
Étape 3 : compléter les dates et confirmer "Démarrer la vente".</br>
<u>Pour arrêter une commande groupée :</u></br>
Étape 1 : aller sur la page du groupe et cliquer sur "Arrêter la vente".</br>
Étape 2 : confirmer "Arrêter la vente".</br>
</br>
<i>Pour plus de détails, veuillez consulter la question suivante :</br>
lien</i>';
/* Comportement en l'absence de résultats: Global : Zone de texte */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'Vous n\'avez aucun membre dans votre groupe.';
$handler->display->display_options['empty']['area']['format'] = 'plain_text';
/* Relation: Adhésion au groupe : Groupe gid */
$handler->display->display_options['relationships']['group']['id'] = 'group';
$handler->display->display_options['relationships']['group']['table'] = 'group_membership';
$handler->display->display_options['relationships']['group']['field'] = 'group';
/* Relation: Adhésion au groupe : Utilisateur uid */
$handler->display->display_options['relationships']['user']['id'] = 'user';
$handler->display->display_options['relationships']['user']['table'] = 'group_membership';
$handler->display->display_options['relationships']['user']['field'] = 'user';
/* Champ: Opérations en masse : Adhésion au groupe */
$handler->display->display_options['fields']['views_bulk_operations_1']['id'] = 'views_bulk_operations_1';
$handler->display->display_options['fields']['views_bulk_operations_1']['table'] = 'group_membership';
$handler->display->display_options['fields']['views_bulk_operations_1']['field'] = 'views_bulk_operations';
$handler->display->display_options['fields']['views_bulk_operations_1']['label'] = '';
$handler->display->display_options['fields']['views_bulk_operations_1']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['views_bulk_operations_1']['vbo_settings']['display_type'] = '0';
$handler->display->display_options['fields']['views_bulk_operations_1']['vbo_settings']['enable_select_all_pages'] = 1;
$handler->display->display_options['fields']['views_bulk_operations_1']['vbo_settings']['row_clickable'] = 1;
$handler->display->display_options['fields']['views_bulk_operations_1']['vbo_settings']['force_single'] = 0;
$handler->display->display_options['fields']['views_bulk_operations_1']['vbo_settings']['entity_load_capacity'] = '10';
$handler->display->display_options['fields']['views_bulk_operations_1']['vbo_operations'] = array(
  'rules_component::rules_block_a_group_membership' => array(
    'selected' => 1,
    'postpone_processing' => 0,
    'skip_confirmation' => 1,
    'override_label' => 1,
    'label' => 'Bloquer les membres sélectionnés',
  ),
  'rules_component::rules_unblock_a_group_membership' => array(
    'selected' => 1,
    'postpone_processing' => 0,
    'skip_confirmation' => 1,
    'override_label' => 1,
    'label' => 'Débloquer les membres sélectionnés',
  ),
);
/* Champ: Groupe : ID du groupe */
$handler->display->display_options['fields']['gid']['id'] = 'gid';
$handler->display->display_options['fields']['gid']['table'] = 'groups';
$handler->display->display_options['fields']['gid']['field'] = 'gid';
$handler->display->display_options['fields']['gid']['relationship'] = 'group';
$handler->display->display_options['fields']['gid']['exclude'] = TRUE;
/* Champ: Utilisateur : Uid */
$handler->display->display_options['fields']['uid']['id'] = 'uid';
$handler->display->display_options['fields']['uid']['table'] = 'users';
$handler->display->display_options['fields']['uid']['field'] = 'uid';
$handler->display->display_options['fields']['uid']['relationship'] = 'user';
$handler->display->display_options['fields']['uid']['exclude'] = TRUE;
/* Champ: Utilisateur : Nom */
$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']['relationship'] = 'user';
$handler->display->display_options['fields']['name']['label'] = 'Nom d\'utilisateur';
$handler->display->display_options['fields']['name']['exclude'] = TRUE;
/* Champ: Global : Texte personnalisé */
$handler->display->display_options['fields']['nothing_3']['id'] = 'nothing_3';
$handler->display->display_options['fields']['nothing_3']['table'] = 'views';
$handler->display->display_options['fields']['nothing_3']['field'] = 'nothing';
$handler->display->display_options['fields']['nothing_3']['label'] = 'Nom d\'utilisateur';
$handler->display->display_options['fields']['nothing_3']['alter']['text'] = '[name]';
$handler->display->display_options['fields']['nothing_3']['alter']['make_link'] = TRUE;
$handler->display->display_options['fields']['nothing_3']['alter']['path'] = 'group/[gid]/member/[uid]';
/* Champ: Utilisateur : Courriel */
$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']['relationship'] = 'user';
$handler->display->display_options['fields']['mail']['link_to_user'] = '0';
/* Champ: Adhésion au groupe : Statut de membre */
$handler->display->display_options['fields']['status']['id'] = 'status';
$handler->display->display_options['fields']['status']['table'] = 'group_membership';
$handler->display->display_options['fields']['status']['field'] = 'status';
$handler->display->display_options['fields']['status']['label'] = 'Statut';
/* Champ: Adhésion au groupe : Group role */
$handler->display->display_options['fields']['role']['id'] = 'role';
$handler->display->display_options['fields']['role']['table'] = 'group_membership';
$handler->display->display_options['fields']['role']['field'] = 'role';
$handler->display->display_options['fields']['role']['label'] = 'Rôles';
$handler->display->display_options['fields']['role']['separator'] = '';
/* Champ: Global : Texte personnalisé */
$handler->display->display_options['fields']['nothing_2']['id'] = 'nothing_2';
$handler->display->display_options['fields']['nothing_2']['table'] = 'views';
$handler->display->display_options['fields']['nothing_2']['field'] = 'nothing';
$handler->display->display_options['fields']['nothing_2']['label'] = 'Metadata';
$handler->display->display_options['fields']['nothing_2']['exclude'] = TRUE;
$handler->display->display_options['fields']['nothing_2']['alter']['text'] = 'metadata';
$handler->display->display_options['fields']['nothing_2']['alter']['make_link'] = TRUE;
$handler->display->display_options['fields']['nothing_2']['alter']['path'] = 'group/[gid]/member/[uid]/metadata';
/* Champ: Global : Texte personnalisé */
$handler->display->display_options['fields']['nothing']['id'] = 'nothing';
$handler->display->display_options['fields']['nothing']['table'] = 'views';
$handler->display->display_options['fields']['nothing']['field'] = 'nothing';
$handler->display->display_options['fields']['nothing']['label'] = 'Modifier';
$handler->display->display_options['fields']['nothing']['exclude'] = TRUE;
$handler->display->display_options['fields']['nothing']['alter']['text'] = 'modifier';
$handler->display->display_options['fields']['nothing']['alter']['make_link'] = TRUE;
$handler->display->display_options['fields']['nothing']['alter']['path'] = 'group/[gid]/member/[uid]/edit?destination=group/[gid]/member';
/* Champ: Global : Texte personnalisé */
$handler->display->display_options['fields']['nothing_1']['id'] = 'nothing_1';
$handler->display->display_options['fields']['nothing_1']['table'] = 'views';
$handler->display->display_options['fields']['nothing_1']['field'] = 'nothing';
$handler->display->display_options['fields']['nothing_1']['label'] = 'Supprimer';
$handler->display->display_options['fields']['nothing_1']['exclude'] = TRUE;
$handler->display->display_options['fields']['nothing_1']['alter']['text'] = 'supprimer';
$handler->display->display_options['fields']['nothing_1']['alter']['make_link'] = TRUE;
$handler->display->display_options['fields']['nothing_1']['alter']['path'] = 'group/[gid]/member/[uid]/cancel?destination=group/[gid]/member';
/* Champ: Global : Texte personnalisé */
$handler->display->display_options['fields']['nothing_4']['id'] = 'nothing_4';
$handler->display->display_options['fields']['nothing_4']['table'] = 'views';
$handler->display->display_options['fields']['nothing_4']['field'] = 'nothing';
$handler->display->display_options['fields']['nothing_4']['label'] = 'Actions';
$handler->display->display_options['fields']['nothing_4']['alter']['text'] = '[nothing_2]   [nothing]   [nothing_1]';
/* Filtre contextuel: Adhésion au groupe : Groupe gid */
$handler->display->display_options['arguments']['group']['id'] = 'group';
$handler->display->display_options['arguments']['group']['table'] = 'group_membership';
$handler->display->display_options['arguments']['group']['field'] = 'group';
$handler->display->display_options['arguments']['group']['default_action'] = 'default';
$handler->display->display_options['arguments']['group']['exception']['title'] = 'Tout';
$handler->display->display_options['arguments']['group']['default_argument_type'] = 'raw';
$handler->display->display_options['arguments']['group']['default_argument_options']['index'] = '1';
$handler->display->display_options['arguments']['group']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['group']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['group']['summary_options']['items_per_page'] = '25';
/* Critère de filtrage: Adhésion au groupe : Statut de membre */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'group_membership';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = array(
  'active' => 'active',
  'blocked' => 'blocked',
  'invited' => 'invited',
);
$handler->display->display_options['filters']['status']['exposed'] = TRUE;
$handler->display->display_options['filters']['status']['expose']['operator_id'] = 'status_op';
$handler->display->display_options['filters']['status']['expose']['label'] = 'Filtrer les membres';
$handler->display->display_options['filters']['status']['expose']['operator'] = 'status_op';
$handler->display->display_options['filters']['status']['expose']['identifier'] = 'status';
$handler->display->display_options['filters']['status']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  5 => 0,
  8 => 0,
  4 => 0,
  9 => 0,
  7 => 0,
  3 => 0,
);
$handler->display->display_options['filters']['status']['expose']['reduce'] = TRUE;

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'group/%/member';
$handler->display->display_options['menu']['type'] = 'tab';
$handler->display->display_options['menu']['title'] = 'Membres';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['context'] = 0;
$handler->display->display_options['menu']['context_only_inline'] = 0;
$handler->display->display_options['tab_options']['weight'] = '0';
$translatables['group_members'] = array(
  t('Master'),
  t('Liste des membres'),
  t('plus'),
  t('Appliquer'),
  t('Réinitialiser'),
  t('Trier par'),
  t('Asc'),
  t('Desc'),
  t('<strong>Légende :</strong></br>
Actif = fait partie du groupe et a accès aux offres groupées.</br>
Bloqué = fait partie du groupe mais n\'a plus accès aux offres groupées.</br>
Invité = a été invité dans le groupe mais n\'a pas encore accepté l\'invitation.'),
  t('<strong>Instructions :</strong></br>
<u>Pour démarrer une commande groupée :</u></br>
Étape 1 : mettre à jour la liste des membres.</br>
Étape 2 : aller sur la page du groupe et cliquer sur "Démarrer la vente".</br>
Étape 3 : compléter les dates et confirmer "Démarrer la vente".</br>
<u>Pour arrêter une commande groupée :</u></br>
Étape 1 : aller sur la page du groupe et cliquer sur "Arrêter la vente".</br>
Étape 2 : confirmer "Arrêter la vente".</br>
</br>
<i>Pour plus de détails, veuillez consulter la question suivante :</br>
lien</i>'),
  t('Vous n\'avez aucun membre dans votre groupe.'),
  t('Groupe'),
  t('Utilisateur'),
  t('- Choisir une opération -'),
  t('Bloquer les membres sélectionnés'),
  t('Débloquer les membres sélectionnés'),
  t('ID du groupe'),
  t('.'),
  t(','),
  t('Uid'),
  t('Nom d\'utilisateur'),
  t('[name]'),
  t('Courriel'),
  t('Statut'),
  t('Rôles'),
  t('Metadata'),
  t('metadata'),
  t('Modifier'),
  t('modifier'),
  t('Supprimer'),
  t('supprimer'),
  t('Actions'),
  t('[nothing_2]   [nothing]   [nothing_1]'),
  t('Tout'),
  t('Filtrer les membres'),
  t('Page'),
);

Here is the Rules debug log :

enter image description here enter image description here

8
  • @Pierre.Vriens This is the view we created in a previous question. Do you have a similar problem ?
    – user54067
    Commented Nov 26, 2016 at 21:23
  • Something else to check: VBO comes with a submodule actions_permissions is it yes or no enabled? If it is, try to do a test with it disabled Commented Nov 26, 2016 at 21:36
  • @Pierre.Vriens I will update my question with screenshot in English. The submodule is disabled and the rights of the view are "authenticated user". I still have the same problem.
    – user54067
    Commented Nov 26, 2016 at 21:59
  • @Pierre.Vriens I have updated the question. I have never used the Rules debug log. Is this what you asked for ?
    – user54067
    Commented Nov 27, 2016 at 12:46
  • @Pierre.Vriens I checked my view, my components and rights. Everything is correct, but impossible to block, unblock or delete a member with bulk operation. I do not understand where to get the blocking.
    – user54067
    Commented Nov 27, 2016 at 16:57

1 Answer 1

0

I was able to create a similar scenario. Long story short:

  • for my admin user (user/1) everything works as desired (as in your case).
  • for an authenticated user which is not an admin, I also get a similar message in the log, which looks like so:

    Skipped Block a group membership on group_membership Member Demo.User in Drupal for Sitebuilders due to insufficient permissions.

Additionally, after I enable the Rules log for the admin user, I get a log that looks like so:

  • Reacting on Event Drupal is initializing.
  • Executing action rule: Block a group membership.
  • Reacting on Event Drupal is initializing.

If however I perform the same scenario with the non-admin user, a similar Rules log does NOT include that "Executing action rule: Block a group membership.". That explains why your "members are still active" (as in your question), simply because the actual Rules Component related to that VBO action was not executed.

As a potential remedy, have a look at the VBO issue "Custom Action Stopped Working", which appears to be similar, and includes some possible work around (such as going back to a prior VBO release, if that's what you want to do ...). But this issue also appears to be related to "Default action behaviors in getAccessMask()". And that issue contains a patch attached to comment nr 29, which in subsequent comments seems to confirm that it does solve the issue (I've not QA-tested that patch ...).

I'm afraid that the above is "as good as it gets" for now ...

Update: even though I've not QA-tested it (yet), it seems that the patch mentioned in https://www.drupal.org/node/1334088#comment-11870650 is a fix for it (credits: Mathieu)

5
  • Thank you for your prompt response. I applied the patch but it does not work for me. I still have the same mistake in the paper.
    – user54067
    Commented Dec 1, 2016 at 22:34
  • Good evening and Happy New Year. Have you had time to study this question ?
    – user54067
    Commented Jan 11, 2017 at 17:50
  • @Mathieu Bonne Annee! Give me some time to refresh my memory about this question (I'll get back to you about it soon)! Commented Jan 11, 2017 at 17:54
  • This patch fixes the problem :-) drupal.org/node/1334088#comment-11870650
    – user54067
    Commented Jan 16, 2017 at 19:29
  • @Mathieu : interessant, merci! Check the update I added to my answer (to avoid that info gets lost if mods cleanup comments again). Commented Jan 16, 2017 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.