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.

Blog Module

Discuss the Blog Module.

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

Blog author and date fields not updating


Reply

6 Posts   1520 Views

Avatar
Bruce B

10 December 2012 at 5:29pm Community Member, 145 Posts

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?

Avatar
Bruce B

13 December 2012 at 6:50pm Community Member, 145 Posts

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.

Avatar
allenmccabe

5 February 2013 at 10:37am Community Member, 5 Posts

I am also having this problem; SS3.

Avatar
Benwitz

24 July 2013 at 2:38pm (Last edited: 24 July 2013 5:32pm), Community Member, 7 Posts

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

Avatar
Bruce B

16 October 2013 at 7:39pm Community Member, 145 Posts

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.

Avatar
Spiggley

15 February 2014 at 12:08am Community Member, 12 Posts

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.