Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
<?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;
Comments
Comment #1
Chi CreditAttribution: Chi commentedComment #2
larowlanNeeds reroll for /core changes.
Comment #3
realitylooprerolled for /core
Comment #4
larowlanSimple patch to reduce duplicate logic.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to 7.x and 8.x. Thanks!