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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Blog Won't Work...


Go to End


7 Posts   2756 Views

Avatar
morethanfire

Community Member, 13 Posts

25 June 2008 at 8:13am

I am trying to get my blog to work, but currently if you go the url it shows a blank page (no source or anything). The blog is the most recent module version and i am using 2.2.2. My host is MediaTemple (gs). Everything else is working correctly, I think at least. I have reinstalled the blog module, but that did not work. I am getting some errors through email, they are down below. Is there anything I can do to fix this?

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c02/h05/mnt/41947/domains/domainname.com/html/blog/_config.php:10)
At line 95 in /nfs/c02/h05/mnt/41947/domains/domainname.com/html/sapphire/misc/GoogleSitemap.php 

header(Content-type: application/xml; charset="utf-8") 
line 95 of GoogleSitemap.php

GoogleSitemap->index(Array) 
line 261 of Controller.php

Controller->run(Array) 
line 104 of Director.php

Director::direct(/sitemap.xml) 
line 158 of main.php

and

Error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Live`.*, `BlogEntry_Live`.*, `BlogHolder_Live`.*, `UserDefinedForm_Live`.*, `GalleryPage_Live`.*, `ArticlePage_Live`.*, `ErrorPage_Live`.*, `RedirectorPage_Live`.*, `VirtualPage_Live`.*, `SubscribeForm_Live`.*, `SiteTree_Live`.ID, if(`SiteTree_Live`.ClassName,`SiteTree_Live`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree_Live` LEFT JOIN `BlogEntry_Live` ON `BlogEntry_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `BlogHolder_Live` ON `BlogHolder_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `UserDefinedForm_Live` ON `UserDefinedForm_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `GalleryPage_Live` ON `GalleryPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ArticlePage_Live` ON `ArticlePage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ErrorPage_Live` ON `ErrorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `RedirectorPage_Live` ON `RedirectorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `VirtualPage_Live` ON `VirtualPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `SubscribeForm_Live` ON `SubscribeForm_Live`.ID = `SiteTree_Live`.ID WHERE (`ParentID` = 25 AND ShowInMenus = 1  AND Date BETWEEN 'blog-1-1' AND 'blog-12-31') AND (`SiteTree_Live`.ClassName IN ('Page','BlogEntry','BlogHolder','UserDefinedForm','GalleryPage','ArticleHolder','ArticlePage','HomePage','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm')) ORDER BY `BlogEntry_Live`.Date DESC LIMIT 0, 10 | Column 'Date' in where clause is ambiguous
 At line 431 in /nfs/c02/h05/mnt/41947/domains/domainname.com/html/sapphire/core/model/Database.php 


user_error(DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Live`.*, `BlogEntry_Live`.*, `BlogHolder_Live`.*, `UserDefinedForm_Live`.*, `GalleryPage_Live`.*, `ArticlePage_Live`.*, `ErrorPage_Live`.*, `RedirectorPage_Live`.*, `VirtualPage_Live`.*, `SubscribeForm_Live`.*, `SiteTree_Live`.ID, if(`SiteTree_Live`.ClassName,`SiteTree_Live`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree_Live` LEFT JOIN `BlogEntry_Live` ON `BlogEntry_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `BlogHolder_Live` ON `BlogHolder_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `UserDefinedForm_Live` ON `UserDefinedForm_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `GalleryPage_Live` ON `GalleryPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ArticlePage_Live` ON `ArticlePage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ErrorPage_Live` ON `ErrorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `RedirectorPage_Live` ON `RedirectorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `VirtualPage_Live` ON `VirtualPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `SubscribeForm_Live` ON `SubscribeForm_Live`.ID = `SiteTree_Live`.ID WHERE (`ParentID` = 25 AND ShowInMenus = 1  AND Date BETWEEN 'blog-1-1' AND 'blog-12-31') AND (`SiteTree_Live`.ClassName IN ('Page','BlogEntry','BlogHolder','UserDefinedForm','GalleryPage','ArticleHolder','ArticlePage','HomePage','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm')) ORDER BY `BlogEntry_Live`.Date DESC LIMIT 0, 10 | Column 'Date' in where clause is ambiguous,256) 
line 431 of Database.php

Database->databaseError(Couldn't run query: SELECT `SiteTree_Live`.*, `BlogEntry_Live`.*, `BlogHolder_Live`.*, `UserDefinedForm_Live`.*, `GalleryPage_Live`.*, `ArticlePage_Live`.*, `ErrorPage_Live`.*, `RedirectorPage_Live`.*, `VirtualPage_Live`.*, `SubscribeForm_Live`.*, `SiteTree_Live`.ID, if(`SiteTree_Live`.ClassName,`SiteTree_Live`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree_Live` LEFT JOIN `BlogEntry_Live` ON `BlogEntry_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `BlogHolder_Live` ON `BlogHolder_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `UserDefinedForm_Live` ON `UserDefinedForm_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `GalleryPage_Live` ON `GalleryPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ArticlePage_Live` ON `ArticlePage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ErrorPage_Live` ON `ErrorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `RedirectorPage_Live` ON `RedirectorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `VirtualPage_Live` ON `VirtualPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `SubscribeForm_Live` ON `SubscribeForm_Live`.ID = `SiteTree_Live`.ID WHERE (`ParentID` = 25 AND ShowInMenus = 1  AND Date BETWEEN 'blog-1-1' AND 'blog-12-31') AND (`SiteTree_Live`.ClassName IN ('Page','BlogEntry','BlogHolder','UserDefinedForm','GalleryPage','ArticleHolder','ArticlePage','HomePage','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm')) ORDER BY `BlogEntry_Live`.Date DESC LIMIT 0, 10 | Column 'Date' in where clause is ambiguous,256) 
line 108 of MySQLDatabase.php

MySQLDatabase->query(SELECT `SiteTree_Live`.*, `BlogEntry_Live`.*, `BlogHolder_Live`.*, `UserDefinedForm_Live`.*, `GalleryPage_Live`.*, `ArticlePage_Live`.*, `ErrorPage_Live`.*, `RedirectorPage_Live`.*, `VirtualPage_Live`.*, `SubscribeForm_Live`.*, `SiteTree_Live`.ID, if(`SiteTree_Live`.ClassName,`SiteTree_Live`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree_Live` LEFT JOIN `BlogEntry_Live` ON `BlogEntry_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `BlogHolder_Live` ON `BlogHolder_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `UserDefinedForm_Live` ON `UserDefinedForm_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `GalleryPage_Live` ON `GalleryPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ArticlePage_Live` ON `ArticlePage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ErrorPage_Live` ON `ErrorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `RedirectorPage_Live` ON `RedirectorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `VirtualPage_Live` ON `VirtualPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `SubscribeForm_Live` ON `SubscribeForm_Live`.ID = `SiteTree_Live`.ID WHERE (`ParentID` = 25 AND ShowInMenus = 1  AND Date BETWEEN 'blog-1-1' AND 'blog-12-31') AND (`SiteTree_Live`.ClassName IN ('Page','BlogEntry','BlogHolder','UserDefinedForm','GalleryPage','ArticleHolder','ArticlePage','HomePage','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm')) ORDER BY `BlogEntry_Live`.Date DESC LIMIT 0, 10,256) 
line 81 of DB.php

DB::query(SELECT `SiteTree_Live`.*, `BlogEntry_Live`.*, `BlogHolder_Live`.*, `UserDefinedForm_Live`.*, `GalleryPage_Live`.*, `ArticlePage_Live`.*, `ErrorPage_Live`.*, `RedirectorPage_Live`.*, `VirtualPage_Live`.*, `SubscribeForm_Live`.*, `SiteTree_Live`.ID, if(`SiteTree_Live`.ClassName,`SiteTree_Live`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree_Live` LEFT JOIN `BlogEntry_Live` ON `BlogEntry_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `BlogHolder_Live` ON `BlogHolder_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `UserDefinedForm_Live` ON `UserDefinedForm_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `GalleryPage_Live` ON `GalleryPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ArticlePage_Live` ON `ArticlePage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `ErrorPage_Live` ON `ErrorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `RedirectorPage_Live` ON `RedirectorPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `VirtualPage_Live` ON `VirtualPage_Live`.ID = `SiteTree_Live`.ID LEFT JOIN `SubscribeForm_Live` ON `SubscribeForm_Live`.ID = `SiteTree_Live`.ID WHERE (`ParentID` = 25 AND ShowInMenus = 1  AND Date BETWEEN 'blog-1-1' AND 'blog-12-31') AND (`SiteTree_Live`.ClassName IN ('Page','BlogEntry','BlogHolder','UserDefinedForm','GalleryPage','ArticleHolder','ArticlePage','HomePage','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm')) ORDER BY `BlogEntry_Live`.Date DESC LIMIT 0, 10) 
line 157 of SQLQuery.php

SQLQuery->execute() 
line 1519 of DataObject.php

DataObject->instance_get(`ParentID` = 25 AND ShowInMenus = 1  AND Date BETWEEN 'blog-1-1' AND 'blog-12-31',`BlogEntry`.Date DESC,,0, 10,DataObjectSet) 
line 1502 of DataObject.php

DataObject::get(Page,`ParentID` = 25 AND ShowInMenus = 1  AND Date BETWEEN 'blog-1-1' AND 'blog-12-31',`BlogEntry`.Date DESC,,0, 10) 
line 51 of BlogHolder.php

BlogHolder->BlogEntries() 

call_user_func_array(Array,Array) 
line 177 of Object.php

Object->__call(BlogEntries,Array) 

BlogHolder_Controller->BlogEntries() 

call_user_func_array(Array,Array) 
line 542 of ViewableData.php

ViewableData->cachedCall(BlogEntries,,) 
line 583 of ViewableData.php

ViewableData->hasValue(BlogEntries) 
line 38 of .cache.nfs.c02.h05.mnt.41947.domains.domainname.com.html.blog.templates.Layout.BlogHolder.ss

include(/nfs/c02/h05/mnt/41947/domains/domainname.com/html/silverstripe-cache/.cache.nfs.c02.h05.mnt.41947.domains.domainname.com.html.blog.templates.Layout.BlogHolder.ss) 
line 197 of SSViewer.php

SSViewer->process(BlogHolder_Controller) 
line 189 of SSViewer.php

SSViewer->process(BlogHolder_Controller) 
line 296 of Controller.php

Controller->defaultAction(blog,Array) 
line 267 of Controller.php

Controller->run(Array) 
line 22 of ModelAsController.php

ModelAsController->run(Array) 
line 104 of Director.php

Director::direct(blog/blog) 
line 158 of main.php

Avatar
Willr

Forum Moderator, 5523 Posts

26 June 2008 at 2:02pm

Column 'Date' in where clause is ambiguous 

Blog module has a field called date you probably have another column called Date as well, this is conflicting. Make sure any of your SQL code has the correct table in the filter rather then just filtering by "Date DESC" you need to do "`BlogEntry`.`Date` DESC" and check your code does `YourPageType`.`Date` instead of Date in any DataObject gets or SQL

Avatar
morethanfire

Community Member, 13 Posts

30 June 2008 at 2:05pm

I am not exactly sure what that all means, ha. I have found "Date DESC" in the BlogHolder.php file. But really don't know what to do with it. Here's the line below.

return DataObject::get("Page","`ParentID` = $this->ID AND ShowInMenus = 1 $tagCheck $dateCheck","`BlogEntry`.Date DESC",'',"$start, $limit");

Avatar
Willr

Forum Moderator, 5523 Posts

30 June 2008 at 2:18pm

Looking through your error query I see you had - ArticlePage_Live so you followed the tutorial correct?

Well the tutorial uses a field called 'Date' on the ArticlePage.php file - open it and check. If it does then what you might have to do is - if you followed the whole tutorial you would have written a method called LatestNews() in HomePage.php

In the tutorial it looks something like

function LatestNews($num=5) {
  $news = DataObject::get_one("ArticleHolder");
  return ($news) ? DataObject::get("ArticlePage", "ParentID = $news->ID", "Date DESC", "", $num) : false;
}

Now you can see that 3rd parameter is "Date DESC" this might be conflicting - as theres 2 Date fields now - on your ArticlePage.php and your BlogEntry.php file. How you can fix this is by changing that method to sort in the format `ArticlePage`.Date which says what table as well as what field you want to sort by rather then just "Date". So you would change the LatestNews() method to

function LatestNews($num=5) {
  $news = DataObject::get_one("ArticleHolder");
  return ($news) ? DataObject::get("ArticlePage", "ParentID = $news->ID", "`ArticlePage`.Date DESC", "", $num) : false;
}

Avatar
morethanfire

Community Member, 13 Posts

30 June 2008 at 6:42pm

Sweet! I got that, thanks for that I would have never been able to pin-point that down.

Still the blog is showing up blank. I am not sure what this is. I have switch the blog entry under the hold to a regular page and the blog works, but I rather not have to do this. Is there anything that I may do?

Cameron

Avatar
Willr

Forum Moderator, 5523 Posts

30 June 2008 at 8:22pm

hmm yes the blank blog page has come up before - namely http://silverstripe.com/site-builders-forum/flat/105499 I have no idea what it could be. What version of the blog are you trying to use

Avatar
morethanfire

Community Member, 13 Posts

1 July 2008 at 4:33am

I am using v0.1. I've tried reinstalling it a couple times looking through couple pages of code (not great at code, unless I really know what I am looking at). I also took a look at my server logs and there aren't any errors in there, accept for one not being able to find a script (fixed that). I am on MediaTemple's grid, could there be some issue with what server you are set up on, etc? I have noticed a horrible lag, takes a half minute to load the site sometimes.

The only error I am getting through email now is this over and over again.

Warning: Cannot modify header information - headers already sent by (output started at /nfs/c02/h05/mnt/41947/domains/regimentdesign.com/html/blog/_config.php:10)
 At line 95 in /nfs/c02/h05/mnt/41947/domains/regimentdesign.com/html/sapphire/misc/GoogleSitemap.php 


header(Content-type: application/xml; charset="utf-8") 
line 95 of GoogleSitemap.php

GoogleSitemap->index(Array) 
line 261 of Controller.php

Controller->run(Array) 
line 104 of Director.php

Director::direct(/sitemap.xml) 
line 158 of main.php