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.
notice: Undefined index: status in /modules/comment/comment.module on line 779.
notice: Undefined variable: status in /modules/comment/comment.module on line 857.
Comment | File | Size | Author |
---|---|---|---|
#4 | comment_notices_0.patch | 3.34 KB | webernet |
#3 | comment_notices.patch | 3.27 KB | webernet |
#1 | comment.module_81.patch | 78.55 KB | julien |
Comments
Comment #1
julien CreditAttribution: julien commentedHi,
I have reproduce this issue, and i have seen by a var_dump of $edit that two fields were missing in this array : $edit['mail'] and $edit['homepage'].
i have add a line before the query to add this two fields who are called by the sql query the next line.
To fix the second notice with $status, i check if the $status is set or not.
For $edit['mail'], i think we can set it up by a sql query who will get the email of this user by his uid. For the homepage, i don't know there is no field in the user table for it.
Hope this will help.
Comment #2
fwalch CreditAttribution: fwalch commentedYou should create a patch instead of uploading the whole file. Read this handbook page to learn how to create patches for Drupal.
Comment #3
webernet CreditAttribution: webernet commentedAttached patch fixes the notices, as well as a code style (indenting) issue.
It also fixes what appears to be a bug: comments that have been approved are not returned to the moderation queue after being edited by a user without 'post comments without approval' permission.
Comment #4
webernet CreditAttribution: webernet commentedSlightly faster and cleaner.
Comment #5
Freso CreditAttribution: Freso commentedAs much as I agree that this is a bug (even a possibly related one) and should be fixed ASAP, I'm still leaning towards having it filed as a separate issue with a separate patch. ("One fix per patch.")
Comment #6
webernet CreditAttribution: webernet commentedOne of the notices is due to the missing status field in a query, therefore fixing it requires setting the status and, as a direct consequence, fixing the related bug.
Comment #7
Freso CreditAttribution: Freso commentedAlright then.
I can reproduce the bug. Applying the patch (which happens cleanly) fixes it as advertised. I didn't test the moderation bug, thus not marking RTBC.
Comment #8
Gábor HojtsyLooks good, so once both bugs are tested against, I think this is ready to go.
Comment #9
Freso CreditAttribution: Freso commentedI added a new user to the install, that only had permissions to access and post comments without approval. Before the patch, the user got notices after editing comments, and the already-approved comments were directly re-approved. After the patch, the notices are gone and the comment is put back into moderation. All in all, the patch works as advertised. :)
Marking RTBC per Gábor's comment.
Comment #10
Gábor HojtsyThanks, committed.
Comment #11
(not verified) CreditAttribution: commented