Commit a1f25d31 authored by webchick's avatar webchick

#835802 by aaronbauman: Fixed DBTNG: INSERT query in forum.install should use dynamic query format.

parent 665a0c33
......@@ -291,5 +291,16 @@ function forum_update_7001() {
db_create_table('forum_index', $forum_index);
db_query('INSERT INTO {forum_index} (SELECT n.nid, n.title, f.tid, n.sticky, n.created, ncs.last_comment_timestamp, ncs.comment_count FROM {node} n INNER JOIN {forum} f on n.vid = f.vid INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid)');
$select = db_select('node', 'n');
$forum_alias = $select->join('forum', 'f', 'n.vid = f.vid');
$ncs_alias = $select->join('node_comment_statistics', 'ncs', 'n.nid = ncs.nid');
->fields('n', array('nid', 'title', 'sticky', 'created'))
->fields($forum_alias, array('tid'))
->fields($ncs_alias, array('last_comment_timestamp', 'comment_count'));
->fields(array('nid', 'title', 'sticky', 'created', 'tid', 'last_comment_timestamp', 'comment_count'))
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