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.
Situation
- You have no comments on the site.
- You visit admin/content/comment and hit Update to create any action, though the list is empty.
Following those steps, gets you the following error:
* Warning: array_diff(): Argument #1 is not an array in comment_admin_overview_validate() (line 113 of /home/manuel/htdocs/d7/modules/comment/comment.admin.inc).
* Please select one or more comments to perform the update on.
Comment | File | Size | Author |
---|---|---|---|
#3 | comment_warning.png | 207.81 KB | aspilicious |
#1 | comment-bulk-operations.patch | 934 bytes | mr.baileys |
Comments
Comment #1
mr.baileysPatch attached that verifies that $form_state['values']['comments'] is an array before performing array operations on it.
Also, the validation handler starts with:
Looking at comment_admin_overview, I don't see how $form_state['values']['comments'] can contain the value "0", so I suspect that this is a remnant from earlier times and have tentatively removed the array_diff portion since I think it is no longer needed...
Comment #2
mr.baileysComment #3
aspilicious CreditAttribution: aspilicious commentedStill an issue and #1 still applies and works
"Looking at comment_admin_overview, I don't see how $form_state['values']['comments'] can contain the value "0", so I suspect that this is a remnant from earlier times and have tentatively removed the array_diff portion since I think it is no longer needed..."
Can someone gives this note a review and mark this rtbc (if the note is correct)
Comment #5
ff1 CreditAttribution: ff1 commented#1: comment-bulk-operations.patch queued for re-testing.
Comment #7
dixon_I have tested this on both 7.x and 8.x. The issue seems to have been fixed somewhere else.