It happens because the comment_form function uses $node->format, but... $node is undefined. It should use the $edit array.

Patch attached.

CommentFileSizeAuthor
comment.module.patch-a593 bytesmarkus_petrux
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dries’s picture

What do you mean with 'not correctly shown'? How to reproduce?

markus_petrux’s picture

ok, please try this:

1) Create a new comment and change the default input format (filtered html) to say full html.
2) Complete the comment and save it.
3) Now, try to edit the comment again. Bang!

It looks like the input format used to enter the comment is the default again.

But the problem is the input format value is retrieved from $node which is undefined as described above. ;-)

Dries’s picture

Committed to HEAD.

What happens when someone edits a comment with a format he or she doesn't have access to? Can you give that a try?

markus_petrux’s picture

Status: Needs review » Fixed

Committed to HEAD.

Changing issue status to fixed, then.

What happens when someone edits a comment with a format he or she doesn't have access to? Can you give that a try?

Good question. TBH, I haven't tried, but I guess if that happens, the user will get an error because of the following code executed by the function comment_validate()

  // Validate filter format
  if (array_key_exists('format', $edit) && !filter_access($edit['format'])) {
    form_set_error('format', t('The supplied input format is invalid.'));
  }

Anyway, if a problem arises here, it would be another issue, I think.

Anonymous’s picture

Status: Fixed » Closed (fixed)