function forum_update_7011

Update {forum_index} so that only published nodes are indexed.

Related topics

File

modules/forum/forum.install, line 447

Code

function forum_update_7011() {
  $select = db_select('node', 'n')->fields('n', array(
    'nid',
  ))
    ->condition('status', 0);
  db_delete('forum_index')->condition('nid', $select, 'IN')
    ->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.