Debug (Versioned::get_version() in line 982 of Versioned.php)

SELECT "SiteTree_versions"."ClassName", "SiteTree_versions"."Created", "SiteTree_versions"."LastEdited", "SiteTree_versions"."URLSegment", "SiteTree_versions"."Title", "SiteTree_versions"."MenuTitle", "SiteTree_versions"."Content", "SiteTree_versions"."MetaTitle", "SiteTree_versions"."MetaDescription", "SiteTree_versions"."MetaKeywords", "SiteTree_versions"."ExtraMeta", "SiteTree_versions"."ShowInMenus", "SiteTree_versions"."ShowInSearch", "SiteTree_versions"."HomepageForDomain", "SiteTree_versions"."ProvideComments", "SiteTree_versions"."Sort", "SiteTree_versions"."HasBrokenFile", "SiteTree_versions"."HasBrokenLink", "SiteTree_versions"."Status", "SiteTree_versions"."ReportClass", "SiteTree_versions"."CanViewType", "SiteTree_versions"."CanEditType", "SiteTree_versions"."ToDo", "SiteTree_versions"."Version", "SiteTree_versions"."Priority", "SiteTree_versions"."ParentID", "SiteTree_versions"."SubsiteID", "SiteTree_versions"."MasterPageID", "Page_versions"."ExtraLinkText", "Page_versions"."InheritWidgetArea", "Page_versions"."WidgetAreaID", "Page_versions"."ExtraLinkID", "Page_versions"."MainImageID", "Product_versions"."Summary", "Product_versions"."NonSpecialPrice", "Product_versions"."SauceColor", "Product_versions"."IsStandard", "Product_versions"."AmountCurrency", "Product_versions"."AmountAmount", "Product_versions"."StockLevelID", "SiteTree_versions"."ID", CASE WHEN "SiteTree_versions"."ClassName" IS NOT NULL THEN "SiteTree_versions"."ClassName" ELSE 'SiteTree' END AS "RecordClassName", "SiteTree_versions"."RecordID", "SiteTree_versions"."Version", "SiteTree_versions"."WasPublished", "SiteTree_versions"."AuthorID", "SiteTree_versions"."PublisherID", "SiteTree_versions"."RecordID" AS "ID" FROM "SiteTree_versions" LEFT JOIN "Page_versions" ON "Page_versions"."RecordID" = "SiteTree_versions"."RecordID" AND "Page_versions"."Version" = "SiteTree_versions"."Version" LEFT JOIN "Product_versions" ON "Product_versions"."RecordID" = "SiteTree_versions"."RecordID" AND "Product_versions"."Version" = "SiteTree_versions"."Version" WHERE ("SiteTree_versions"."ClassName" IN ('Product')) AND ("SiteTree_versions"."RecordID" = 188 AND "SiteTree_versions"."Version" = 8) AND ("SiteTree_versions"."SubsiteID" IN (2)) ORDER BY "Sort"

Debug (Versioned::get_version() in line 983 of Versioned.php)

(bool) false
GET /shop/gift-packs/twin-christmas-sauce-gift-pack/

[User Error] Versioned::get_version: Couldn't get Product.188, version 8

GET /shop/gift-packs/twin-christmas-sauce-gift-pack/

Line 984 in /home/hhgf/public_html/sapphire/core/model/Versioned.php

Source

975 		Versioned::set_reading_mode('');
976 
977 		$baseTable = ClassInfo::baseDataClass($class);
978 		$query = singleton($class)->buildVersionSQL("\"{$baseTable}\".\"RecordID\" = $id AND \"{$baseTable}\".\"Version\" = $version");
979 		$record = $query->execute()->record();
980 		$className = $record['ClassName'];
981 		if(!$className) {
982 			Debug::show($query->sql());
983 			Debug::show($record);
984 			user_error("Versioned::get_version: Couldn't get $class.$id, version $version", E_USER_ERROR);
985 		}
986 
987 		Versioned::set_reading_mode($oldMode);
988 		return new $className($record);
989 	}
990 

Trace