From 3944a8b13988fba4fd66bf441818e5be33a8681e Mon Sep 17 00:00:00 2001 From: Rastislav Brandobur Date: Thu, 16 Mar 2023 23:32:34 +0100 Subject: [PATCH] fixed table name for the given class Fixed error: [Unknown Error] Uncaught mysqli_sql_exception: Incorrect table name ''. --- src/EagerLoadedDataList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EagerLoadedDataList.php b/src/EagerLoadedDataList.php index 73a3e51..ad70680 100644 --- a/src/EagerLoadedDataList.php +++ b/src/EagerLoadedDataList.php @@ -122,7 +122,7 @@ public function eagerLoadHasOne(&$ids, $hasOnes, $withHasOnes) $dep = $depSeq[0]; $fields[] = "\"{$dep}ID\""; } - $table = Config::forClass($this->dataClass)->get('table_name'); + $table = DataObject::getSchema()->tableName($this->dataClass); $data = new SQLSelect($fields, '"' . $table . '"', ['"ID" IN (' . implode(',', $ids) . ')']); $data = Utils::EnsureArray($data->execute(), 'ID');