From 0161f4f6d74921d273812d5ee241c2049fbc3e78 Mon Sep 17 00:00:00 2001 From: phpnut Date: Tue, 28 Aug 2007 21:44:47 +0000 Subject: [PATCH] Fixes #3118 Prefix in models : can't use allow empty tablePrefix with a prefix defined in DATABASE_CONFIG git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5593 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo_source.php | 5 +---- cake/libs/model/model.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 3ddd1871c..198063891 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -446,10 +446,7 @@ class DboSource extends DataSource { */ function fullTableName($model, $quote = true) { if (is_object($model)) { - $table = $model->table; - if ($model->tablePrefix != null && !empty($model->tablePrefix)) { - $table = $model->tablePrefix . $table; - } + $table = $model->tablePrefix . $model->table; } elseif (isset($this->config['prefix'])) { $table = $this->config['prefix'] . strval($model); } else { diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index a5ee109ff..f0da7e3b0 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1924,7 +1924,7 @@ class Model extends Overloadable { } $db =& ConnectionManager::getDataSource($this->useDbConfig); - if (!empty($db->config['prefix']) && $this->tablePrefix !== false) { + if (!empty($db->config['prefix']) && $this->tablePrefix === null) { $this->tablePrefix = $db->config['prefix']; }