Hi,
I've found that a node_comments and node_comment_form ctools content types couldn't be used in the node view panel when a Page Preview module is used for a new node preview. I know that them were not designed to be used with nodes that don't exist, but will be greate it them will not return any error in this case.

Current result:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'nid' cannot be null: INSERT INTO {history} (uid, nid, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => 1392891715 ) in node_tag_new() (line 312 of modules/node/node.module).
and

Notice: Trying to get property of non-object in comment_form() (line 1876 of modules/comment/comment.module).
Notice: Trying to get property of non-object in comment_form() (line 1878 of modules/comment/comment.module).
Notice: Trying to get property of non-object in comment_form() (line 2009 of modules/comment/comment.module).
Notice: Trying to get property of non-object in comment_form() (line 2023 of modules/comment/comment.module).
Notice: Trying to get property of non-object in comment_form() (line 2031 of modules/comment/comment.module).
Notice: Trying to get property of non-object in comment_form() (line 2037 of modules/comment/comment.module).
Notice: Trying to get property of non-object in comment_form() (line 2043 of modules/comment/comment.module).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dimitrius’s picture

Status: Active » Needs review

Chris Matthews’s picture

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

The 5 year old patch to node_comment_form.inc and node_comments.inc does not apply to the latest ctools 7.x-1.x-dev so +Needs reroll

Checking patch plugins/content_types/node_context/node_comment_form.inc...
error: while searching for:
  if (empty($node)) {
    $block->content = t('Comment form here.');
  }
  else if ($node->comment == COMMENT_NODE_OPEN) {
    if (user_access('post comments')) {
      $comment = new stdClass();
      $comment->nid = $node->nid;

error: patch failed: plugins/content_types/node_context/node_comment_form.inc:27
error: plugins/content_types/node_context/node_comment_form.inc: patch does not apply
Checking patch plugins/content_types/node_context/node_comments.inc...
error: while searching for:
  if (empty($node)) {
    $block->content = t('Node comments go here.');
  }
  else if ($node->comment) {
    $block->content = ctools_comment_render($node, $conf);
    // Update the history table, stating that this user viewed this node.
    node_tag_new($node);

error: patch failed: plugins/content_types/node_context/node_comments.inc:29
error: plugins/content_types/node_context/node_comments.inc: patch does not apply