Jump to:

10848 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Workflow how to trigger ScheduledPublishing?

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1848 Views
  • b4rd3
    Avatar
    Community Member
    2 Posts

    Workflow how to trigger ScheduledPublishing? Link to this post

    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.

  • mark_s
    Avatar
    Community Member
    78 Posts

    Re: Workflow how to trigger ScheduledPublishing? Link to this post

    Hi.

    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

    Mark

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Workflow how to trigger ScheduledPublishing? Link to this post

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

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: Workflow how to trigger ScheduledPublishing? Link to this post

    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)

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: Workflow how to trigger ScheduledPublishing? Link to this post

    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.

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: Workflow how to trigger ScheduledPublishing? Link to this post

    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:
    doc.silverstripe.org/doku.php?id=sake
    http://manual.b2evolution.net/Set_up_a_Windows_Scheduled_Task

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

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: Workflow how to trigger ScheduledPublishing? Link to this post

    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?

  • MonkeyFish
    Avatar
    Community Member
    12 Posts

    Re: Workflow how to trigger ScheduledPublishing? Link to this post

    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."

    1848 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.