Commit ec4eba68 authored by Dries's avatar Dries

- Patch #323528 by jhedstrom: fixed alias usage in queries for PostgreSQL.

parent eb9aefe8
......@@ -603,14 +603,14 @@ function locale_translate_import_form() {
if (!count($names)) {
$languages = _locale_prepare_predefined_list();
$default = array_shift(array_keys($languages));
$default = key($languages);
}
else {
$languages = array(
t('Already added languages') => $names,
t('Languages not yet added') => _locale_prepare_predefined_list()
);
$default = array_shift(array_keys($names));
$default = key($names);
}
$form = array();
......
......@@ -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']);
......
......@@ -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),
);
}
}
}
......
......@@ -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');
}
......
......@@ -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'];
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment