Warning: Invalid argument supplied for foreach() in _block_rehash() (line 336 of block.module).
because statistics_block_info() function may return NULL
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | test.php_.txt | 327 bytes | pasqualle |
| statistics_block_info.patch | 791 bytes | pasqualle |
Comments
Comment #1
dawehnerManual testing fixed the issue. Patch looks fine.
Comment #2
attheshow commentedStill getting this error even with this patch installed. Whenever I try to configure blocks. Wasn't happening in Alpha 3. Only in Alpha 4.
Comment #3
webchickHm. That sounds like a needs work? Or at least a needs review?
The patch looks pretty sane to me, though.
Comment #4
jpamental commentedI'm running a very fresh (today) install of alpha 4 - was getting this error and tried the patch (on the statistics module, not the block module) and it cleared it right up. No errors anymore.
Comment #5
dries commentedThe code in the patch is valid. If there is still a problem, it ought to be an additional problem. Therefore, I decided to commit this patch to CVS HEAD. Thanks.
Comment #7
henrijs.seso commentedIt looks like this warning is back again. Drupal 7.9 after installing modules.
Comment #8
zil0484 commentedyes i got this problem also with 7.9. pls solve this
Comment #9
pasquallecan you tell the full error message? I would like to know the line number, as there are more foreach loops in _block_rehash().
Comment #10
pasqualleif it is the same error, then running the attached file will tell you which module has a wrong hook_block_info() implementation.
- rename the file to test.php, copy it into the Drupal root folder and open it in the browser (mysite.com/test.php)
Comment #11
tungpham42 commentedI got this same error message on Drupal 7.7 every time I install new modules.
Warning: Invalid argument supplied for foreach() in _block_rehash() (line 385 of /mysite/modules/block/block.module)Comment #12
Juan C commentedI also had this error: "Warning: Invalid argument supplied for foreach() in _block_rehash() (line 385 of /mysite/modules/block/block.module)"
#10 help me find the culprit. Thanks.
Comment #13
yahya.akhtar commentedstatistics_block_info.patch queued for re-testing.
Comment #15
yahya.akhtar commentedstatistics_block_info.patch queued for re-testing.
Comment #17
stevenjohn commentedBe great to get this fixed, I also have the same issue:
Warning: Invalid argument supplied for foreach() in _block_rehash() (line 385 of /public_html/modules/block/block.module).
When i tested where the error was coming from it says its the Linkedin module...
Steve
Comment #18
Rhino commentedI just installed the linkedin module on a clean Drupal 7 install and got:
Warning: Invalid argument supplied for foreach() in _block_rehash() (line 389 of /drupal/htdocs/modules/block/block.module).
Comment #19
pasqualleIf you have the LinkedIn module used on your site, then here is your issue: #1371500: hook_block_info() must return an array() - warns "Invalid argument supplied for foreach() in _block_rehash()"
Comment #20
oscardax commentedThanks Pasqualle!!
I had a custom module not returning anything in hook_block_info() and so I was getting the warning.
Comment #21
dddave commentedThis isn't a core issue but a contrib issue. Resetting correct status.