Removing users from class' doesn't affect courses

Paul_P
Forums
Hi, I noticed that, after installing the update to 1.29 (we skipped 1.28), it is not possible anymore to remove users from courses via the corresponding class. I could verify this behaviour at demo.opigno.org by removing the student-user from the class. Now, student can be added to the class' courses but when trying to remove him, he remains in these courses. Moreover, the "member since"-value in the courses seems to be reset. I also deleted his membership in a particular course of that class beforehand - so it can be assured that the user has only been added via the respective class. Has anything been changed in the rules-module or do you have any advice how to alter the systems behaviour? Thanks in advance and best regards, Paul.
admin

Hi Paul,

Hi Paul,

Are you sure? I just tested it on the demo platform as well as on a fresh instance and the user was correctly removed.

Are you sure the user is not part of another class that contains that course? In that case he is not removed. 

 

Best regards

Paul_P

Hi admin,

Hi admin, yes, I experienced the issue on a platform with only one class. I am pretty sure that the demo-platform can reproduce this, since I managed to remove student from one course, then reenabled his membership via the class. When having removed student from the class, he stays in that course. Best regards, Paul.
admin

Hi Paul,

Hi Paul, Can you give me detailed steps on how i can reproduce this issue? Best regards
admin

Hi,

Hi, I managed to reproduce it. It seems to be only an issue when using the operations batch functionality. If the user is removed not using the operations batch functionality it works correctly. We will take a look why. I will keep this issue updated. Best regards
Paul_P

Hi admin,

Hi admin, thanks for the test! I regularly use the batch operations for editing the course membership, so you're probably right. On our platform there is a link beside "edit" (right outer column) that also activates the batch operations for removing a single user - that's why the "Remove user from group"-option is rather not my choice... Best regards, Paul.
admin

Hi Paul,

Hi Paul,

I found the issue with the views_bulk_operations.

In the file opigno_lms/modules/contrib/og/includes/actions/membership_delete.actions.inc,

Please add the following to the function og_membership_delete_action_info.

 function og_membership_delete_action_info() {  return array(    'og_membership_delete_action' => array(      'type' => 'og_membership',      'label' => t('Remove from group'),      'configurable' => FALSE,+++      'behavior' => array('no_behavior'),    )  );} Or you can implement the hook_action_info_alter(&$actions) in another module and add the behavior that way. Just clear the cache and it will work as expected. Best regards
Paul_P

Hi admin,

Hi admin, thanks a lot for the quick solution - I'll try this out! Best regards, Paul.
admin

https://www.drupal.org

https://www.drupal.org/project/opigno_lms/issues/2953675