Repeatable:
Always
Steps to repeat:
1. configure a content type with comment open
2. create a new node of previous defined type via code or devel generate
To create a node via code:
$edit_node = array(
'nid' => NULL,
'type' => 'article',
'title' => 'Prova',
'uid' => 1,
'revision' => 1,
'status' => TRUE,
'promote' => 0,
'created' => REQUEST_TIME,
'langcode' => LANGUAGE_NOT_SPECIFIED,
);
$node = entity_create('node', $edit_node);
$node->save();
Expected Results:
Comment for node is open.
$node->comment = COMMENT_NODE_OPEN;
Actual Results:
Comment status property is missing.
$node->comment = undefined;
Comments
Comment #1
mavimo commentedTo solve this issue we need to change hook_node_prepare to hook_node_create.
Patch worked with @peximo during drupal code sprint.
Comment #2
mavimo commentedComment #3
plachLooks sensible to me. We need tests for this.
Comment #4
peximo commentedAdded tests.
Comment #7
larowlanComments no longer tied to nodes