if ($entity_type == 'node' && $entity->status && _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.
    if (!isset($first_call[$entity->nid])) {
      $first_call[$entity->nid] = FALSE;
      db_delete('forum_index')->condition('nid', $entity->nid)->execute();
    // Only save data to the table if the node is published.
    if ($entity->status) {

It looks as second if ($entity->status) always evaluates as TRUE;

#3 1302364-duplicate_status_check_in_forum_field_storage_pre_update-3.patch2.02 KBrealityloop
PASSED: [[SimpleTest]]: [MySQL] 33,821 pass(es). View
#1 duplicate_status_check_in_forum_field_storage_pre_update-1302364-0.patch2 KBChi
PASSED: [[SimpleTest]]: [MySQL] 33,292 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


Chi’s picture

Status: Active » Needs review
Issue tags: +needs backport to D7
2 KB
PASSED: [[SimpleTest]]: [MySQL] 33,292 pass(es). View
larowlan’s picture

Status: Needs review » Needs work
Issue tags: +Novice

Needs reroll for /core changes.

realityloop’s picture

Status: Needs work » Needs review
2.02 KB
PASSED: [[SimpleTest]]: [MySQL] 33,821 pass(es). View

rerolled for /core

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Simple patch to reduce duplicate logic.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x and 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.