mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Return NULL in Versioned::get_latest_version() if no record was found (fixes #4015)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76603 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4c94455a4d
commit
21c295d2e3
@ -713,6 +713,8 @@ class Versioned extends DataObjectDecorator {
|
|||||||
$query = singleton($class)->buildVersionSQL("\"{$baseTable}\".\"RecordID\" = $id", "\"{$baseTable}\".\"Version\" DESC");
|
$query = singleton($class)->buildVersionSQL("\"{$baseTable}\".\"RecordID\" = $id", "\"{$baseTable}\".\"Version\" DESC");
|
||||||
$query->limit = 1;
|
$query->limit = 1;
|
||||||
$record = $query->execute()->record();
|
$record = $query->execute()->record();
|
||||||
|
if(!$record) return;
|
||||||
|
|
||||||
$className = $record['ClassName'];
|
$className = $record['ClassName'];
|
||||||
if(!$className) {
|
if(!$className) {
|
||||||
Debug::show($query->sql());
|
Debug::show($query->sql());
|
||||||
|
Loading…
Reference in New Issue
Block a user