summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Stevenson2009-01-08 16:38:20 (GMT)
committer Karen Stevenson2009-01-08 16:38:20 (GMT)
commit39308765ba791c58c92e0504e4464bd48bb26fcc (patch)
treef4999cd09a2b11089c501d2d7c101291dbd0b2d1
parent886646cd563017a5780b3e822ef818b493c4ff75 (diff)
#196421 Prefixed tables weren't getting queried correctly, patch by markus_petrux.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--content.module8
2 files changed, 4 insertions, 5 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 6a6b427..18b576b 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -3,6 +3,7 @@
CCK 6.x-2.x
===========
+- #196421 Prefixed tables weren't getting queried correctly.
- Don't assume display_settings[$context] always exists, newly enabled modules may add new contexts that weren't there when the field was last edited.
- #339537 by markus_petrux: fix orphan fields in {content_group_fields} table when fields are removed.
- Views integration: use shorter titles in Views admin summaries (see http://drupal.org/node/326034).
diff --git a/content.module b/content.module
index 9ea39ab..1a16d4d 100644
--- a/content.module
+++ b/content.module
@@ -2428,8 +2428,7 @@ function content_max_delta($field_name, $type_name = NULL) {
if (empty($type_name) || $content_type['type'] == $type_name) {
foreach ($content_type['fields'] as $field) {
$db_info = content_database_info($field);
- $table = $db_info['table'];
- if (db_result(db_query("SELECT COUNT(*) FROM {$table}")) >= 1) {
+ if (db_result(db_query("SELECT COUNT(*) FROM {". $db_info['table'] ."}")) >= 1) {
return 0;
}
}
@@ -2441,12 +2440,11 @@ function content_max_delta($field_name, $type_name = NULL) {
// in the node table to limit the type.
else {
$db_info = content_database_info($field);
- $table = $db_info['table'];
if (!empty($type_name)) {
- $delta = db_result(db_query("SELECT MAX(delta) FROM {$table} f LEFT JOIN {node} n ON f.vid = n.vid WHERE n.type = '%s'", $type_name));
+ $delta = db_result(db_query("SELECT MAX(delta) FROM {". $db_info['table'] ."} f LEFT JOIN {node} n ON f.vid = n.vid WHERE n.type = '%s'", $type_name));
}
else {
- $delta = db_result(db_query("SELECT MAX(delta) FROM {$table}"));
+ $delta = db_result(db_query("SELECT MAX(delta) FROM {". $db_info['table'] ."}"));
}
if ($delta >= 0) {
return $delta;