Jump to:

1851 Posts in 1606 Topics by 561 members

Blog Module

SilverStripe Forums » Blog Module » Blog author and date fields not updating

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 1471 Views
  • Bruce B
    Avatar
    Community Member
    145 Posts

    Blog author and date fields not updating Link to this post

    I'm just setting up a new blog in SS3 and have found an odd problem.
    I'm using the current github version of the Blog module and SS 3.03

    If I create a new blog entry through the blog screens, the author and date fields don't appear when the blog entry is published. If I go into the admin screens and look at the same blog entry, the author and date fields are populated. Publishing from the admin screens means the fields then appear on the blog pages.

    If I look at the MySQL data, the BlogEntry table has data in the author and date fields but the BlogEntry_Live table has NULL in those fields. Publishing through the admin screens populates the BlogEntry_Live table entries.

    Is this a general bug? Or just caused by something I have screwed up? More importantly, is there a fix?

  • Bruce B
    Avatar
    Community Member
    145 Posts

    Re: Blog author and date fields not updating Link to this post

    I have started again with a clean install of SS 3.03 along with the blog master from Github, Widgets(v0.1) from the modules list,along with userforms, recaptcha and spamprotection (all SS 3 compatible versions).

    The end result is the same:
    The author and date do not display if the entry is created through the blog screens.
    The content entry field is also a straight textarea. Despite

    BlogEntry::allow_wysiwyg_editing();

    appearing in the _config.php file

    It does not translate BBcode either.

    Bugger - I was hoping this new site could be done before Christmas. No it looks like I have some digging around blog source code to find a fix.

  • allenmccabe
    Avatar
    Community Member
    5 Posts

    Re: Blog author and date fields not updating Link to this post

    I am also having this problem; SS3.

  • Benwitz
    Avatar
    Community Member
    7 Posts

    Re: Blog author and date fields not updating Link to this post

    same problem, any solutions or tips? content is saved to the blogentry table but not to blogentry_live, publishing on the backend pushes it to blogentry_live

    ** Update **
    Based on info found here:
    http://doc.silverstripe.org/framework/en/topics/versioning

    I modified one line of code in the 'PostBlog' function of BlogHolder.php from $blogentry->writeToStage("Stage"); to $blogentry->writeToStage("Live");

    it gets the post up but marks it deleted from draft in the CMS. may be a helpful work around to someone

  • Bruce B
    Avatar
    Community Member
    145 Posts

    Re: Blog author and date fields not updating Link to this post

    For anyone still watching:

    Following up on Benwitz' idea, I Investigated BlogHolder.php a little more closely.

    Replace line 313    $blogentry->writeToStage("Stage");

    with the following:

          $blogentry->Status = "Published";
          $blogentry->write();

    and the author and date fields are correctly published to both databases.

    Now I just have to work out why TinyMCE isn't showing up in the content field.

  • Spiggley
    Avatar
    Community Member
    12 Posts

    Re: Blog author and date fields not updating Link to this post

    I have just installed blog (master branch) with ss 3.1.1.

    I encountered the author and date fields not updating, and amended as suggested by Bruce B, but in cms the post is marked as deleted from draft. Also Front end form entry does not allow paragraphs. Allowing wysiwyg in config seems to make no difference. I have to admit I am no great php coder. Anybody out there who has overcome these problems?

    Any help recieved gratefully.

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