Skip to content
Snippets Groups Projects
Commit ee57d320 authored by Aaron Bauman's avatar Aaron Bauman
Browse files

Issue #1832860 - set entity status using property_exists rather than isset() and empty()

parent ad5251ad
No related branches found
No related tags found
No related merge requests found
...@@ -1166,8 +1166,8 @@ function _sf_entity_import_preprocess_entity(&$entity, $entity_type, $bundle_nam ...@@ -1166,8 +1166,8 @@ function _sf_entity_import_preprocess_entity(&$entity, $entity_type, $bundle_nam
// After that node_object_prepare() can be called to set default values. // After that node_object_prepare() can be called to set default values.
node_object_prepare($entity); node_object_prepare($entity);
} }
// Set the node to published, if a status has not already been set. // Status property must be set.
if (!isset($entity->status) || empty($entity->status)) { if (!property_exists($entity, 'status')) {
$entity->status = 1; $entity->status = 1;
} }
// To save a node, a uid must be set. // To save a node, a uid must be set.
...@@ -1203,8 +1203,8 @@ function _sf_entity_import_preprocess_entity(&$entity, $entity_type, $bundle_nam ...@@ -1203,8 +1203,8 @@ function _sf_entity_import_preprocess_entity(&$entity, $entity_type, $bundle_nam
*/ */
function _sf_entity_import_process_entity(&$entity, $entity_type, $bundle_name = NULL) { function _sf_entity_import_process_entity(&$entity, $entity_type, $bundle_name = NULL) {
if ($entity_type == 'user') { if ($entity_type == 'user') {
// If status is still empty, set it to 1 (active) // Status property must be set.
if (!isset($entity->status) || empty($entity->status)) { if (!property_exists($entity, 'status')) {
$entity->status = 1; $entity->status = 1;
} }
// If the created date is still empty, set it to now. // If the created date is still empty, set it to now.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment