Jump to:

10375 Posts in 2190 Topics by 1707 members

All other Modules

SilverStripe Forums » All other Modules » Save and Publish producing error after installation of CMSWorkflow

Discuss all other Modules here.

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 853 Views
  • Laurie
    Avatar
    Community Member
    21 Posts

    Save and Publish producing error after installation of CMSWorkflow Link to this post

    After the installation of CMS Workflow, the "Save and Publish" button is no longer working properly.

    First, here is the code that I added to the \mysite\_config.php file for a two-step workflow:

    // CMSWorkflow
    Object::add_extension('WorkflowRequest', 'WorkflowTwoStepRequest');
    Object::add_extension('SiteTree', 'SiteTreeCMSTwoStepWorkflow');
    Object::add_extension('LeftAndMain', 'LeftAndMainCMSWorkflow');
    Object::add_extension('SiteConfig', 'SiteConfigTwoStepWorkflow');
    LeftAndMainCMSWorkflow::set_prompt_admin_for_comments(false);

    Too much? Too little? Something I missed?

    So...after an edit is made to a page and I select "Save and Publish," I received an error that says "Error saving content" and the "Publishing..." button just keeps spinning. However, if I refresh the page, the change has actually been saved.

    In my SilverStripe error log, I get the following error:
    Warning at \sapphire\email\Mailer.php line 163: mail() [<a href='function.mail'>function.mail</a>]: Failed to connect to mailserver at &quot;localhost&quot; port 25, verify your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set()

    I'm guessing that the error is related to the fact that it wants to email something but can't...I don't need anything e-mailed, so how do I just turn that option off?

    Thanks.

  • Anonymous user
    Avatar
    Community Member
    1 Post

    Re: Save and Publish producing error after installation of CMSWorkflow Link to this post

    First of all, for 2-step workflow you shouldn't need to change anything in your _config.php, it will be installed automatically.
    You only need to customise the _config.php for 3-step workflow. However, the set_prompt_admin_for_comments is something you may still want in config.

    Secondly, it looks like your php installation isn't set up right for your email environment. I can't help you there, I'm afraid, but workflow is configured by default to send emails at various stages.

    To disable the emails, you may want something like this in your mysite/_config.php:

    WorkflowRequest::set_alert('WorkflowPublicationRequest', 'request', 'publisher', false);
    WorkflowRequest::set_alert('WorkflowPublicationRequest', 'approve', 'publisher', false);
    WorkflowRequest::set_alert('WorkflowPublicationRequest', 'deny', 'publisher', false);
    WorkflowRequest::set_alert('WorkflowPublicationRequest', 'cancel', 'publisher', false);
    WorkflowRequest::set_alert('WorkflowDeletionRequest', 'request', 'publisher', false);
    WorkflowRequest::set_alert('WorkflowDeletionRequest', 'approve', 'publisher', false);
    WorkflowRequest::set_alert('WorkflowDeletionRequest', 'deny', 'publisher', false);
    WorkflowRequest::set_alert('WorkflowDeletionRequest', 'cancel', 'publisher', false);

    I'm not positive the lines above disable ALL emails, have a look a WorkflowRequest or WorkflowTwoStepRequest to be sure.

    Cheers,
    - Luke

  • Laurie
    Avatar
    Community Member
    21 Posts

    Re: Save and Publish producing error after installation of CMSWorkflow Link to this post

    Thanks, Luke...your code worked perfectly!

    Cheers,
    Laurie

  • Anonymous user
    Avatar
    Community Member
    1 Post

    Re: Save and Publish producing error after installation of CMSWorkflow Link to this post

    Cheers, glad to hear it!

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