diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index b334c42..dbe67a2 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -545,7 +545,7 @@ function forum_field_storage_pre_insert($entity_type, $entity, &$skip_fields) {
 function forum_field_storage_pre_update($entity_type, $entity, &$skip_fields) {
   $first_call = &drupal_static(__FUNCTION__, array());
 
-  if ($entity_type == 'node' && $entity->status && _forum_node_check_node_type($entity)) {
+  if ($entity_type == 'node' && _forum_node_check_node_type($entity)) {
     // We don't maintain data for old revisions, so clear all previous values
     // from the table. Since this hook runs once per field, per object, make
     // sure we only wipe values once.
@@ -553,21 +553,23 @@ function forum_field_storage_pre_update($entity_type, $entity, &$skip_fields) {
       $first_call[$entity->nid] = FALSE;
       db_delete('forum_index')->condition('nid', $entity->nid)->execute();
     }
-    $query = db_insert('forum_index')->fields(array('nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp'));
-    foreach ($entity->taxonomy_forums as $language) {
-      foreach ($language as $item) {
-        $query->values(array(
-          'nid' => $entity->nid,
-          'title' => $entity->title,
-          'tid' => $item['tid'],
-          'sticky' => $entity->sticky,
-          'created' => $entity->created,
-          'comment_count' => 0,
-          'last_comment_timestamp' => $entity->created,
-        ));
+    if ($entity->status) {
+      $query = db_insert('forum_index')->fields(array('nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp'));
+      foreach ($entity->taxonomy_forums as $language) {
+        foreach ($language as $item) {
+          $query->values(array(
+            'nid' => $entity->nid,
+            'title' => $entity->title,
+            'tid' => $item['tid'],
+            'sticky' => $entity->sticky,
+            'created' => $entity->created,
+            'comment_count' => 0,
+            'last_comment_timestamp' => $entity->created,
+          ));
+        }
       }
+      $query->execute();
     }
-    $query->execute();
     // The logic for determining last_comment_count is fairly complex, so
     // call _forum_update_forum_index() too.
     _forum_update_forum_index($entity->nid);
diff --git a/core/modules/forum/forum.test b/core/modules/forum/forum.test
index c7c3d9c..8686095 100644
--- a/core/modules/forum/forum.test
+++ b/core/modules/forum/forum.test
@@ -190,6 +190,62 @@ class ForumTestCase extends DrupalWebTestCase {
   }
 
   /**
+   * Unpublished topics should not appear at the topic list once unpublished.
+   */
+  function testUnpublishTopic() {
+    // Login the user
+    $this->drupalLogin($this->admin_user);
+    $this->container = $this->editForumTaxonomy();
+    // Create forum container.
+    $this->container = $this->createForum('container');
+    // Create forum inside the forum container.
+    $this->forum = $this->createForum('forum', $this->container['tid']);
+
+    $this->drupalGet('forum');
+
+    // We create one forum topic.
+    $myTopic = $this->createForumTopic($this->forum);
+
+    // Verify the topic and post counts on the forum page.
+    $this->drupalGet('forum');
+
+    // Verify that the number of topics shown is correct.
+    $num_topics = $this->get_topics_number($this->forum);
+    $this->assertEqual($num_topics, 1, t('Number of topics found.'));
+
+    // Check if the topic is listed.
+    $this->drupalGet('forum/'. $this->forum['tid']);
+    $this->assertLink($myTopic->title);
+
+    // Unpublish the topic.
+    $myTopic->status = 0;
+    node_save($myTopic);
+
+    // Verify the post count is now 0 on the forum page.
+    $this->drupalGet('forum');
+
+    // Verify that the number of topics shown is correct
+    $num_topics = $this->get_topics_number($this->forum);
+    $this->assertEqual($num_topics, 0, t('Number of topics found.'));
+
+    // Check if the topic is not listed anymore.
+    $this->drupalGet('forum/'.$this->forum['tid']);
+    $this->assertNoLink($myTopic->title);
+  }
+
+  /**
+   * Gets the topics count of a given forum.
+   *
+   * @param array $forum The taxonomy term data of the forum.
+   */
+  function get_topics_number($forum) {
+    $forum_arg = array(':forum' => 'forum-list-' . $forum['tid']);
+    $xpath = $this->buildXPathQuery('//tr[@id=:forum]//td[@class="topics"]', $forum_arg);
+    $topics = $this->xpath($xpath);
+    return (int)trim($topics[0]);
+  }
+
+  /**
    * Run admin tests on the admin user.
    *
    * @param object $user The logged in user.
