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.

Blog Module /

Discuss the Blog Module.

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

Blog Archive List - link error


Go to End


1811 Views

Avatar
boombox

Community Member, 44 Posts

17 March 2009 at 4:40pm

Hi - Just picking up on the blog post http://www.silverstripe.org/archive/show/221139#post221139
Issue is the monthly archive links didn't work. The error was:
"Column 'Date' in where clause is ambiguous"

Fix is to change Date to `BlogEntry`.Date to identify the relevant posts.

Line 43 of BlogHolder.php

if(is_numeric($month) && is_numeric($month)){
$dateCheck = "AND `BlogEntry`.Date BETWEEN '$year-$month-1' AND '$year-$month-31'";
}
else if(isset($year)){
$dateCheck = "AND `BlogEntry`.Date BETWEEN '$year-1-1' AND '$year-12-31'";
}

Can thi sbe added to SVN release by someone