Because of the use of empty, the status of an entity can never be set to 0 prior to _sf_entity_import_process_entity or _sf_entity_import_preprocess_entity being called. Here are two examples found in sf_entity.module:

Lines 1119-1122:

    // Set the node to published, if a status has not already been set.
    if (!isset($entity->status) || empty($entity->status)) {
      $entity->status = 1;
    }

Lines 1156-1159:

    // If status is still empty, set it to 1 (active)
    if (!isset($entity->status) || empty($entity->status)) {
      $entity->status = 1;
    }

I'd propose the following revision:

    // If status is still empty, set it to 1 (active)
    if (!isset($entity->status) || (empty($entity->status) && $entity->status != 0)) {
      $entity->status = 1;
    }

Comments

kostajh’s picture

Version: 7.x-2.0-alpha3 » 7.x-2.x-dev
Status: Active » Needs work

Please submit a patch if you'd like to see this in 7.x-2.x

aaronbauman’s picture

Component: sf_entity » Code
Status: Needs work » Fixed

committed ee57d320 using a check for property_exists() instead.

Status: Fixed » Closed (fixed)

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