Closed (fixed)
Project:
Rules
Version:
7.x-2.1
Component:
Scheduler
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Sep 2012 at 23:43 UTC
Updated:
11 Feb 2016 at 01:45 UTC
Jump to comment: Most recent
Comments
Comment #1
tevans commentedIt took some digging, but I figured it out. The problem is that in D7, cron is always run as "anonymous", so I had to update the PHP code in the message field to impersonate the super user before embedding the view, then switch back to "anonymous" afterwards:
Comment #2
tevans commentedComment #3
timjh commentedI have a very similar problem, and your solution may work for me, if I were to understand it. Could you please explain where exactly you put the PHP code above?
Comment #4
tevans commentedSure. Add one of the following actions to your rule or component:
On the configuration screen for the action, there is a section labeled "Message". Put your code inside the value field in this section. If I recall correctly, you need to have the PHP filter module from Drupal core enabled for the PHP to be evaluated. You should see a "PHP Evaluation" section inside the "Message" section if it is enabled.
Comment #5
timjh commentedHa! I didn't have PHP filter enabled. All is now clear. Many thanks.
Comment #6
timjh commentedFollowing recommendations, I have PHP filter restricted to administrator use only. Yet it works for anonymous user when invoked by Rules Scheduler!
Presumably Rules Scheduler impersonates the administrator in order to run PHP filter, but not when executing the filtered code (why not?). It must also impersonate the administrator for other rules actions not normally available to an anonymous user, such as publishing or unpublishing a node.
Comment #7
museumboy commentedI'm trying to do the exact thing as TEVANS. The PHP code did not work for me, but gave an out of memory error. I'm wondering if after 3 years a better way has come along.
Comment #8
museumboy commentedFYI the out of memory error was not related to the php code. It works now using the same code as above.