diff --git a/core/model/DataObject.php b/core/model/DataObject.php index 7a6292b67..26f264280 100755 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -2963,13 +2963,12 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity public static function get_by_id($callerClass, $id, $cache = true) { if(is_numeric($id)) { if(is_subclass_of($callerClass, 'DataObject')) { - $tableClasses = ClassInfo::dataClassesFor($callerClass); - $baseClass = array_shift($tableClasses); - return DataObject::get_one($callerClass,"\"$baseClass\".\"ID\" = $id", $cache); + $baseClass = ClassInfo::baseDataClass($callerClass); + return DataObject::get_one($callerClass,"\"$baseClass\".\"ID\" = $id", $cache, 1); // This simpler code will be used by non-DataObject classes that implement DataObjectInterface } else { - return DataObject::get_one($callerClass,"\"ID\" = $id", $cache); + return DataObject::get_one($callerClass,"\"ID\" = $id", $cache, 1); } } else { user_error("DataObject::get_by_id passed a non-numeric ID #$id", E_USER_WARNING); diff --git a/security/Member.php b/security/Member.php index 175e485e9..eee4d4bd3 100755 --- a/security/Member.php +++ b/security/Member.php @@ -557,7 +557,7 @@ class Member extends DataObject { static function currentUser() { $id = Member::currentUserID(); if($id) { - return DataObject::get_one("Member", "\"Member\".\"ID\" = $id"); + return DataObject::get_one("Member", "\"Member\".\"ID\" = $id", true, 1); } }