<?php
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;

Files: 
CommentFileSizeAuthor
#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 ]

Comments

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

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

Needs reroll for /core changes.

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

rerolled for /core

Status:Needs review» Reviewed & tested by the community

Simple patch to reduce duplicate logic.

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.