I am using CiviCRM Entity and Rules to create a linked Drupal account upon the creation of new memberships in CiviCRM.
Now I would like to have a rule to block the linked Drupal account when its associated CiviCRM membership is deleted.
As a simple test case, I have created the following rule:
React on Event: “CiviCRM Membership has been deleted”
Actions: Block a User
Data Selector: civicrm-membership:contact-id-contact:civi-user (Drupal User for contact)
This did not work after deleting the membership in CiviCRM.
Using the direct input mode, I ran another test and substituted the Data Selector with a specific UID of the Drupal user. My Rule did work and blocked the Drupal user with that specific UID immediatly after I deleted a membership in CiviCRM.
So I am now trying to understand which Data Selector for the type “User” I should be using to get the linked Drupal User for the civicrm-member? I have tried all available data selectors for the “Drupal User” listed below, but my rule does not block the user using any of those selectors:
civicrm-membership:contact-id-contact:civi-user
civicrm-membership:contact-id-contact:civi-user:
civicrm-membership:contact-id-contact:civicrm-user
civicrm-membership:contact-id-contact:civicrm-user:
Any help would be very appreciated.
Comments
Comment #1
markusa CreditAttribution: markusa commentedWhat's the status of this issue. Does this work for you in version 2.0-beta1?
Comment #2
btc97 CreditAttribution: btc97 commentedI'm having a similar issue (using 2.0-beta1). What is the difference between :civi-user and :civicrm-user?
Comment #3
markusa CreditAttribution: markusa commentedIf you want to load a user from a Membership rule, say add/update Membership event, then you can add an action
"Fetch Entity by ID", and use
civicrm-membership:contact-id-contact:civi-user:uid
for the Identifier
if you haven't updated to beta3, you should do so.