3

My problem is related to the Drupal 8 versions of these two modules: rules and flag.

What I want to achieve

  • Some node types on my site are offering a global flag as a link (for e.g. "report error" flag)
  • If the user clicks on it, he should be redirected to a special contact form. The flagged node URL should be submitted to an entity reference field automatically on the contact form too.

How I solved it in Drupal 7

In Drupal 7 there was a rules event "node is flagged" to trigger the redirect action. The flagging URL I could pass via Drupal 7 module "entity reference prepopulate" (which functionality is merged into core reference field in Drupal 8).

In Drupal 8 the rules event "node is flagged" seems not to exist.

Any idea how to realise a behaviour like described above in Drupal 8?

THX in advance,

Phil

0

1 Answer 1

4

You need to use the event, After saving new flagging

Add Condition of Flag, and enter flag machine name

Add action of Page redirect, enter the url where you want to redirect. Ex: /node/1

enter image description here

Important

In your flag settings, you need use a link type of Normal link, because it won't work with AJAX

enter image description here

Your Answer

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

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