I have used the code provided at the SSBits site for a number of my Silverstripe sites with no problems whatsoever:
http://www.ssbits.com/tutorials/2009/working-with-banners/
However the first time I've attempted to use the OneRandomBanner function with 2.4.2 I'm getting the following error:
[User Error] Couldn't run query: SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("File"."ClassName" IN ('Image','Image_Cached')) AND (ClassName "Folder" AND ParentID = SELECT ID FROM File WHERE ClassName = "Folder" AND Name = "Headers")) ORDER BY RAND() LIMIT 5 Unknown column 'Folder' in 'where clause'
This is a first - and the column 'Folder' is present.
Can anyone advise on this issue?
Many thanks,
Jayne