Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It happens because the comment_form function uses $node->format
, but... $node is undefined. It should use the $edit
array.
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
comment.module.patch-a | 593 bytes | markus_petrux |
Comments
Comment #1
Dries CreditAttribution: Dries commentedWhat do you mean with 'not correctly shown'? How to reproduce?
Comment #2
markus_petrux CreditAttribution: markus_petrux commentedok, 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. ;-)
Comment #3
Dries CreditAttribution: Dries commentedCommitted 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?
Comment #4
markus_petrux CreditAttribution: markus_petrux commentedChanging issue status to fixed, then.
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()
Anyway, if a problem arises here, it would be another issue, I think.
Comment #5
(not verified) CreditAttribution: commented