summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-12-19 03:55:23 +0000
committerDries Buytaert <dries@buytaert.net>2008-12-19 03:55:23 +0000
commitec4eba68d7eb4ee562a343a093253c550b108202 (patch)
treef583416cb114fb2181be932cae255fba3bade323 /modules
parenteb9aefe8b599feb896339b13ba19e5faf3906b23 (diff)
downloadbrdo-ec4eba68d7eb4ee562a343a093253c550b108202.tar.gz
brdo-ec4eba68d7eb4ee562a343a093253c550b108202.tar.bz2
- Patch #323528 by jhedstrom: fixed alias usage in queries for PostgreSQL.
Diffstat (limited to 'modules')
-rw-r--r--modules/book/book.module3
-rw-r--r--modules/forum/forum.module6
-rw-r--r--modules/system/system.install4
-rw-r--r--modules/taxonomy/taxonomy.admin.inc2
-rw-r--r--modules/taxonomy/taxonomy.pages.inc4
5 files changed, 12 insertions, 7 deletions
diff --git a/modules/book/book.module b/modules/book/book.module
index b5790ce4a..835d214bc 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -625,7 +625,8 @@ function book_prev($book_link) {
// The previous page in the book may be a child of the previous visible link.
if ($prev['depth'] == $book_link['depth'] && $prev['has_children']) {
// The subtree will have only one link at the top level - get its data.
- $data = array_shift(book_menu_subtree_data($prev));
+ $tree = book_menu_subtree_data($prev);
+ $data = array_shift($tree);
// The link of interest is the last child - iterate to find the deepest one.
while ($data['below']) {
$data = end($data['below']);
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 9f9d2d7a2..13ccfda3d 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -227,8 +227,10 @@ function forum_nodeapi_prepare($node) {
if (_forum_nodeapi_check_node_type($node, $vocabulary)) {
if (empty($node->nid)) {
// New topic
- $node->taxonomy[arg(3)]->vid = $vid;
- $node->taxonomy[arg(3)]->tid = arg(3);
+ $node->taxonomy[arg(3)] = (object) array(
+ 'vid' => $vid,
+ 'tid' => arg(3),
+ );
}
}
}
diff --git a/modules/system/system.install b/modules/system/system.install
index 704f57dfa..0e9d8e4d7 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -1336,7 +1336,7 @@ function system_update_6001() {
db_add_primary_key($ret, 'term_node', array('vid', 'tid', 'nid'));
db_add_index($ret, 'term_node', 'vid', array('vid'));
- db_query('UPDATE {term_node} t SET vid = (SELECT vid FROM {node} n WHERE t.nid = n.nid)');
+ db_query('UPDATE {term_node} SET vid = (SELECT vid FROM {node} n WHERE {term_node}.nid = n.nid)');
return $ret;
}
@@ -3014,7 +3014,7 @@ function system_update_7008() {
// Add chid column and convert existing votes.
db_add_field($ret, 'poll_votes', 'chid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
db_add_index($ret, 'poll_votes', 'chid', array('chid'));
- $ret[] = update_sql("UPDATE {poll_votes} v SET chid = (SELECT chid FROM {poll_choices} c WHERE v.chorder = c.chorder AND v.nid = c.nid)");
+ $ret[] = update_sql("UPDATE {poll_votes} SET chid = (SELECT chid FROM {poll_choices} c WHERE {poll_votes}.chorder = c.chorder AND {poll_votes}.nid = c.nid)");
// Remove old chorder column.
db_drop_field($ret, 'poll_votes', 'chorder');
}
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index 938a32609..10f3f74c6 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -909,7 +909,7 @@ function taxonomy_vocabulary_confirm_reset_alphabetical(&$form_state, $vid) {
* @see taxonomy_vocabulary_confirm_reset_alphabetical()
*/
function taxonomy_vocabulary_confirm_reset_alphabetical_submit($form, &$form_state) {
- db_query('UPDATE {term_data} t SET weight = 0 WHERE vid = :vid', array(':vid' => $form_state['values']['vid']));
+ db_query('UPDATE {term_data} SET weight = 0 WHERE vid = :vid', array(':vid' => $form_state['values']['vid']));
drupal_set_message(t('Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name'])));
watchdog('taxonomy', 'Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE);
$form_state['redirect'] = 'admin/content/taxonomy/' . $form_state['values']['vid'];
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc
index e72c8a207..402fa2c77 100644
--- a/modules/taxonomy/taxonomy.pages.inc
+++ b/modules/taxonomy/taxonomy.pages.inc
@@ -31,7 +31,9 @@ function taxonomy_term_page($terms, $depth = 0, $op = 'page') {
switch ($op) {
case 'page':
// Build breadcrumb based on first hierarchy of first term:
- $current->tid = $tids[0];
+ $current = (object) array(
+ 'tid' => $tids[0],
+ );
$breadcrumb = array();
while ($parents = taxonomy_get_parents($current->tid)) {
$current = array_shift($parents);