2

I have created Task nodes, and I want to redirect to the previous (source) page after creation of a new task. I don't want people to see the task node. That page includes a view of all tasks.

For that I have created a simple rule:

  • Event: After saving new content
  • Condition: Content is of type tasks
  • Actions: Page redirect to [site:current-page:url]

This works, but not for a page that includes a query string. The rules redirect action chops off the query string of the source page.

In my case, I have a source page that always includes ?og_group_ref=[node:og-group-ref] in the URL in order to create group tasks. After creating a group tasks, the redirect happens but the query string in the URL is gone.

I tried to change the Rules redirect using Rules Action "Page redirect to [site:current-page:url]?og_group_ref=[node:og-group-ref]". However, that gives an error:

Input evaluation generated an invalid URI.

Is there a way to accomplish Rules redirect including the query string?

0

You may want to try the "Rules URL argument" module to get this to work. Here is a quote about it (from its project page):

... provides two rules conditions based on URL arguments:

  • check if a URL argument is present.
  • compare the value of an URL argument.

It also provides an action that makes the value of an URL argument available as new variable to Rules.

Refer to my answer to "How to use the Rules module to implement a custom redirect for an outdated URL?" for way more details about this module also.

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.