Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Publish method doesn't have the desired effect

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

Page: 1
Go to End
Author Topic: 246 Views
  • Jakx
    Avatar
    Community Member
    3 Posts

    Publish method doesn't have the desired effect Link to this post

    Within SS 3.1.1, when I use:

    $Page->writeToStage("Stage");
    $Page->publish("Stage", "Live");

    This doesn't seem to produce a published version of the page, only a draft version.

    Changes made, that are noticeable within the CMS, aren't being picked up at the front end. For example: If a $has_one relationship ID is changed; that relationship does not call the correct value via template but it's value behaves correctly while viewing the page in the CMS.

    Only when you click the "Published" button in the CMS does the change take effect at the front end.

    Is there any explanation for this?

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Publish method doesn't have the desired effect Link to this post

    Try just write(). Should still work I would imagine. Here's a reference - https://github.com/silverstripe/silverstripe-cms/blob/3.1/code/model/SiteTree.php#L1419

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