I just updated a website from 2.4 to 3.1.2 and installed translateable-module. Most parts are working now, but I get an error on my news/blog page:
Couldn't run query: SELECT DISTINCT count(DISTINCT "SiteTree"."ID") AS "0" FROM "SiteTree" WHERE (ParentID = 9 AND Datum <= '2015-04-28') AND ("SiteTree"."ClassName" IN ('Page','ArticleHolder','ArticlePage','CategoryHolder','HomePage','ProductHolder','SiteMap','ErrorPage','RedirectorPage','VirtualPage')) AND ("SiteTree"."Locale" = 'de_DE') Unknown column 'Datum' in 'where clause'
My filter function:
function FilteredChildren($filter = 'Datum DESC') {
return DataObject::get('Page', "ParentID = {$this->ID} AND Datum <= '" . date('Y-m-d') . "'", $filter);
}
I don't know why it says 'Datum' is missing or unknown. My article's page has this column:
private static $db = array(
'Datum' => 'Date'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', $dateField = new DateField('Datum', 'Artikel Datum'), 'Content');
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat', 'dd.MM.YYYY');
return $fields;
}