17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1678 Views |
-
Blog Won't Work...

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.phpheader(Content-type: application/xml; charset="utf-8")
line 95 of GoogleSitemap.phpGoogleSitemap->index(Array)
line 261 of Controller.phpController->run(Array)
line 104 of Director.phpDirector::direct(/sitemap.xml)
line 158 of main.phpand
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.phpuser_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.phpDatabase->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.phpMySQLDatabase->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.phpDB::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.phpSQLQuery->execute()
line 1519 of DataObject.phpDataObject->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.phpDataObject::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.phpBlogHolder->BlogEntries()
call_user_func_array(Array,Array)
line 177 of Object.phpObject->__call(BlogEntries,Array)
BlogHolder_Controller->BlogEntries()
call_user_func_array(Array,Array)
line 542 of ViewableData.phpViewableData->cachedCall(BlogEntries,,)
line 583 of ViewableData.phpViewableData->hasValue(BlogEntries)
line 38 of .cache.nfs.c02.h05.mnt.41947.domains.domainname.com.html.blog.templates.Layout.BlogHolder.ssinclude(/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.phpSSViewer->process(BlogHolder_Controller)
line 189 of SSViewer.phpSSViewer->process(BlogHolder_Controller)
line 296 of Controller.phpController->defaultAction(blog,Array)
line 267 of Controller.phpController->run(Array)
line 22 of ModelAsController.phpModelAsController->run(Array)
line 104 of Director.phpDirector::direct(blog/blog)
line 158 of main.php -
Re: Blog Won't Work...

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 -
Re: Blog Won't Work...

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");
-
Re: Blog Won't Work...

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;
} -
Re: Blog Won't Work...

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
-
Re: Blog Won't Work...

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
-
Re: Blog Won't Work...

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.phpheader(Content-type: application/xml; charset="utf-8")
line 95 of GoogleSitemap.phpGoogleSitemap->index(Array)
line 261 of Controller.phpController->run(Array)
line 104 of Director.phpDirector::direct(/sitemap.xml)
line 158 of main.php
| 1678 Views | ||
|
Page:
1
|
Go to Top |


