2

I have CiviCRM Entity installed, Drupal Rules, up to date versions of both.

I'm just creating a simple rule that says when a CiviRM Contribution Page is viewed, a "Hello World" message is displayed.

Getting nowhere with it. It does not even trigger Rules at all, so no debug, no log entries.

Works fine with Drupal content.

Am I missing something?

3

The rule will only trigger when the Drupal version of the contribution page at path /civicrm-contribution-page/(id)

We haven't added a feature to trigger the rule event when the civi version of the contribution page is viewed.

  • Woo. In all my years I did not know that you could have Drupal versions of contribution pages. Thanks for the tip. – Tony Horrocks Nov 24 '17 at 8:55
  • Ah I see where this is coming from, CiviCRM Entity. What I actually want to trigger a rule when the user visits the transaction page for the contribution, rather than the contribution page itself. So, for example, if someone visits a contribution transcation page for member renewal, I can check whether they have filled in data elsewhere. – Tony Horrocks Nov 24 '17 at 12:03
2

The way I'm doing it is to use Path Rules module to check the CiviCRM URL for the transact page. So we look for the path say /civicrm/contribute/transact?reset=1&id=1

That triggers the rule. We then fetch the CiviCRM contact entity for the current user.

The Contact entity has all of the custom data in it.

We pass that to a rule component that evaluates a custom field value and does an action as appropriate.

So this rule could be used in a situation where a user has to complete a complex professional registration procedure using Webform CiviCRM, where a profile is not appropriate. Upon completion they are directed to a membership renewal page.

If they try to access the renewal page first, without having made the declaration they are redirected back to the webform.

  • Interesting, thanks for posting your solution. Adding Path Rules to the toolbox! – jackrabbithanna May 11 '18 at 22:15

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.