Hi! My problem is....

After user clicks a button, I want to 'execute custom PHP code' (action in Rules). I also want to refresh the page and show user a message, that the custom code was executed.

So, in order (actions in Rules):
1. refresh the page
2. execute custom PHP code
3. show a configurable message

But, the page doesn't refresh and no message is shown (only after I refresh the node manually - the code is executed as well... but I cannot make user to refresh manually every time).

When the 'Execute custom PHP code' is removed from a triggered rule, page is refreshing normally and message is shown.

Please, help me find out what is happening... I need to execute my code after button is clicked :)

Comments

scalp’s picture

I'm having the same issue. Does anyone know how to make this work. Being able to trigger custom PHP code would be really useful.

MBroberg’s picture

I might be having a related issue. If not, I apologize, I did not intend to just hijack the issue and I will open a new one.
When I just do a page redirect, the Rule works fine, but when I also try to save a file on the server, regardless of the order of events in the Rule, the page will not redirect. The file is saved, so that part of the rule is working (file save action is coming from the Views PDF module).

MBroberg’s picture

I just read another issue that suggests the button trigger is not the problem. Trying to execute the actions with a different trigger still has problems, so it seems more likely that the 2 Rule actions are fighting against each other. I will open my issue in Views PDF.
For original issue and #1, did you try the same exact rules with a different trigger?

BassistJimmyJam’s picture

Assigned: Unassigned » BassistJimmyJam
Status: Active » Postponed (maintainer needs more info)

I was unable to reproduce this, could you please provide an example of the custom code you are trying to run?

BassistJimmyJam’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No response in over two months, closing.

landing’s picture

I've run into the same problem. Can we re-open the issue?