Hi,
My site breaks after upgrading to 2.4.1 from 2.3.2 with the following error
I upgraded both the FileDataObjectManager module and the Silverstripe files. Everything else now works fine, apart from this code which I used to determine whether there were any files (in this case, case study videos) associated with a given page)
The code I used is:
$videos = DataObject::get('CaseStudyVideo','CaseStudyPageID="'.$this->Top()->ID.'"');
$noVideos = $videos->TotalItems();
The error I get back is:
[User Error] Couldn't run query: SELECT "CaseStudyVideo"."ClassName", "CaseStudyVideo"."Created", "CaseStudyVideo"."LastEdited", "CaseStudyVideo"."Name", "CaseStudyVideo"."Width", "CaseStudyVideo"."Height", "CaseStudyVideo"."SortOrder", "CaseStudyVideo"."AttachmentID", "CaseStudyVideo"."ThumbnailID", "CaseStudyVideo"."CaseStudyPageID", "CaseStudyVideo"."ID", CASE WHEN "CaseStudyVideo"."ClassName" IS NOT NULL THEN "CaseStudyVideo"."ClassName" ELSE 'CaseStudyVideo' END AS "RecordClassName" FROM "CaseStudyVideo" WHERE (CaseStudyPageID="188") ORDER BY SortOrder ASC Unknown column '188' in 'where clause'
CaseStudyVideo is the DataObject
This worked fine before the upgrade. Can you spot anything amiss with the code?
Adrian