Przeglądaj źródła

fixed dbName in TableAjax->getRootTableName

Piotr Labudda 9 lat temu
rodzic
commit
bbc40802f5
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      SE/se-lib/TableAcl.php

+ 2 - 1
SE/se-lib/TableAcl.php

@@ -48,7 +48,8 @@ class TableAcl extends Core_AclBase {
 	public function getRootTableName() {
 		if (empty($this->_name)) return null;// throw new Exception("Table name not defined");
 		if ($this->_rootTableName) return $this->_rootTableName;
-		$dbName = DB::getPDO()->getDatabaseName();
+		if (!$this->_db) return null;// throw new Exception("Database not defined in table {$this->_zasobID}");
+		$dbName = DB::getPDO($this->_db)->getDatabaseName();
 		$this->_rootTableName = DB::getPDO()->fetchValue("
 			select t.TABLE_NAME
 			from `information_schema`.`TABLES` t