hi
I installed this module and it works ok, but when I have no comments in queue waiting for approval I have got this message warning:
warning: Invalid argument supplied for foreach() in /home/amwsp0/public_html/hallelujah/sites/all/modules/comment_moderation/comment_moderation.module on line 301.
It looks like a foreach loop doesn't have check for null/zero items in queue.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | comment_moderation.patch | 623 bytes | truyenle |
| #2 | comment_moderation.patch | 352 bytes | craigmc |
Comments
Comment #1
tstackhouse commentedI ran into this bug as well, I just threw in a small edit on line 300 of comment_moderation.module to fix it.
I changed:
To read:
And that did the trick nicely. I'm not entirely certain how to make a patch, given my current setup, otherwise I'd submit one for this, I hope this helps out anyone and/or makes it into the next version of this module.
Comment #2
craigmc commentedPlease find patch attached.
Comment #4
hellaswebnews commentedthx. worked fine!
Comment #5
verta commentedCould this be released from dev? 1.1 maybe?
Comment #6
David Lesieur commentedIt's not fixed until it has been committed...
Comment #7
truyenle commentedI couldn't apply the patch from #2, I make another one for this.
Truyenle
Comment #8
manoloka commentedIt did the trick for me ... wonder if this'll be commited sometime ?
Thanks great module
Comment #9
mudsurfer commentedI applied the patch in #7 manually to my site and it worked to solve this error.
Tks
Comment #10
u4umar commentedEasy Solution
Edit the file in any editor "comment_moderation.module"
Change in comment_moderation_form_alter(&$form, $form_state, $form_id) {
Replace this line "if ($form['#parameters'][2] == "approval") {"
with this "if ($form['#parameters'][2] == "approval" && is_array($form['operations'])) {"
and save.
The problem will be solved.
I have applied this in my drupal site. http://www.pepads.com
Comment #11
manoloka commentedmmm ... weird
When I did it the first time didn't solve my prob but it did this time ??? obviously I did something wrong that time.
Thanks