When posting comments, I get this error message:
Notice: Undefined index: format in comment_submit() (line 2161 of /.../modules/comment/comment.module).
In each instance the comment does publish, but the error message also appears. Here are the parameters for when the message appears:
- the message appears if a comment title is not allowed
- the message appears if a comment title is allowed, but the field is left blank when the comment is submitted
- the message does not appear if the comment fields are set to filtered text (in the above cases the fields were set to plain text)
Also, this error message may be related and appears when the admin views the comments page for all site comments:
Notice: Undefined index: und in comment_admin_overview() (line 107 of /.../modules/comment/comment.admin.inc).
I'm stumped on how to solve this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | fds | Site-Install.jpg | 103.93 KB | lyricnz |
| #2 | comment-plain-text-notice-1170948.patch | 1013 bytes | lyricnz |
Comments
Comment #1
nuezI can confirm this issue, tried it on a clean install.
Comment #2
lyricnz commentedI can reproduce your first issue. It's caused by the code assuming that a comment-format is set, when this is not set when using plain text. I have added a check for this. I cannot reproduce your second issue - can you describe more about how to reproduce? Do you have multiple languages configured?
Comment #3
nuezOK the patch works for the first issue works, thanks.
Comment #4
wcarpent commentedWhich issue are you referring to as the second issue?
Comment #5
lyricnz commentedThe second issue was:
"Also, this error message may be related and appears when the admin views the comments page for all site comments:
Notice: Undefined index: und in comment_admin_overview() (line 107 of /.../modules/comment/comment.admin.inc)."
I am unable to reproduce this.
If you test and verify the patch above - please change the status of this issue to "reviewed & tested by the community"
Comment #6
lyricnz commentedBump. Please review. #4 was question from third-party.
Comment #7
adamwhite commentedI have also tested and the patch works for me.
Comment #8
HedgeMage commentedI wasn't able to reproduce the problem :(
Comment #9
davidhernandezI am also unable to reproduce the error, in any of the outlined cases.
Comment #10
lyricnz commentedFrom a clean install:
- ensure comment module enabled
- change "text processing" on article /admin/structure/types/manage/article/comment/fields/comment_body to plain text
- create an article
- post a comment on that article, with no subject (it's optional)
See attachment.
Comment #11
davidhernandezThanks, Simon. Those steps worked. Using the steps in #10, I can confirm the patch fixes the error in that case. As posted in #5, I cannot replicate an error on the main comments page.
Comment #12
geerlingguy commentedWe should probably mark this issue as a duplicate of #813052: Undefined index: format in comment_preview line 2065 and line 2183 (which existed prior to this issue), and follow up with the patch there (or we could move discussion into this thread). It's the same bug...
Additionally, patches should go against -dev.
Comment #13
lyricnz commentedDuplicate of #813052: Undefined index: format in comment_preview line 2065 and line 2183.