Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Workflow how to trigger ScheduledPublishing?

Go to End

8 Posts   2633 Views


Community Member, 2 Posts

14 April 2010 at 1:46am

Hi there,

recently we tried to find out how it is possible to use the Embargo Part of the workflow module.

The workflow module works quite nice, but we found no way how to trigger "to-be-published" sites.
It just won't work by itself. Do we have to add it in a page class?

Do we have to trigger it via a cronjob, manually or how is it intended to work?
Maybe a core developer of the module may give us a little hint.

Thanks in advance.


Community Member, 78 Posts

12 May 2010 at 11:09am


Yes, you need to set up a cron job to handle the processing of embargoes and expiries.

You can execute something like this:

php -f /var/www/mysite/sapphire/cli-script.php /dev/tasks/ScheduledPublishing > /var/log/mysite/cron.log



Community Member, 125 Posts

4 September 2010 at 6:44am

How do you notify only one Admin (out of many)?


Community Member, 178 Posts

12 November 2010 at 10:00am

I am also trying to set up workflow (mostly for embargo/expiry) and could use some more docs on the setup, I mean this is the only place I see mention of the cron job..
are the additional config settings we can use.. the PDF supplied really is for front end users, and the readme is a little unclear if you don't understand the module already.

If I use LeftAndMainCMSWorkflow::set_prompt_admin_for_comments(false); can I still set embargo/expiry?

also on the tab with the embargo/expiry settings I don't get a calendar? (I did include the required module - legacydatetimefields)


Community Member, 178 Posts

13 November 2010 at 10:47am

I figured some of the module out once I got an install that was running (had to go with the trunk, the released version just didn't want to run.. one thing to watch for are the security members created by the module... I ended up with multiple members of the same name, clearing them all and running dev/build seemed to get me past that one)
Now I am on a windows machine for dev and am running xampp, it appears I need to setup a Scheduled Task of some sort (not cron since thats a linux script), so any suggestions how I can get the script scheduled?

php -f /var/www/mysite/sapphire/cli-script.php /dev/tasks/ScheduledPublishing > /var/log/mysite/cron.log

I have run http://mysite.local/dev/tasks/ScheduledPublishing and I get an error:
Line 536 in C:\xampp\htdocs\vhost\mysite\httpdocs\sapphire\core\model\MySQLDatabase.php
When I look at the failed SQL statement it looks like it may be from a past version of a page controller, is there any chance that an archived version of the script is being run (from an unpublished and deleted page?).

In anycase running the script directly via dev/.. in my browser has updated my embargo pages, and they are now displaying. So things are moving in the correct direction.


Community Member, 178 Posts

13 November 2010 at 1:22pm

I am trying to setup the cron task, on a windows machine.
it took me a bit of messing around but the windows command to run the script via windows Sheduled Tasks is:

C:\xampp\php\php.exe "C:\vhost\mysite\httpdocs\sapphire\cli-script.php" "/dev/tasks/ScheduledPublishing"

now worth reading are:

I haven't got to adding the path for the log file, I get errors if my command is to long?


Community Member, 178 Posts

14 November 2010 at 6:58am

I am able now to have embargo work for items i wish to publish, but expiry still will not work for me.

when I run /dev/tasks/ScheduledPublishing I get a long sql statement that is in error.
The end of the trace (which has this sql statement) ends with: 'ExpiryDate' in where clause is ambiguous

I therefore guess that this variable is in conflict with another somewhere in the system? But I have searched the entire project and the only uses of ExpiryDate are contained in cmsworkflow.

any other thoughts on the cause?


Community Member, 12 Posts

9 December 2011 at 9:41am

When ever i try and run the cron script it keep redirect asking for login?? How do we run the dev/tasks/ScheduledPublishing script with out login?

The error message the cron is forwarding to me via email is "That page is secured. Enter your credentials below and we will send you right along."