Closed (fixed)
Project:
Quotes
Version:
5.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
1 Jun 2008 at 15:59 UTC
Updated:
29 Jun 2008 at 17:12 UTC
Jump to comment: Most recent file
We're getting numerous php errors in the log:
Invalid argument supplied for foreach() in /home/talldave/public_html/{sitename}/sites/all/modules/quotes/quotes.module on line 481.
MySQL 5.0.45
PHP 5.2.5
What other information can I provide to help you troubleshoot?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | Quotes-Block-Settings.png | 60.4 KB | TallDavid |
| #8 | Quotes-General-Settings.png | 20.04 KB | TallDavid |
| #8 | Quotes-ConfigureBlocks-Settings.png | 9.21 KB | TallDavid |
Comments
Comment #1
nancydruHmm, I have a new feature being tested right now, so my line numbers are way off. Can you give me some idea of where this is, please? Starting with the function name and maybe the actual statement?
Comment #2
TallDavid commentedLine 442:
...
Line 481:
Comment #3
nancydruHmm, do you have a block that isn't returning any quotes?
A few lines up from the "foreach" you will see:
Please try changing the code to:
And let me know if this solves the problem.
Comment #4
TallDavid commentedNancy,
the change made no difference... the error persists.
Comment #5
nancydruThanks. Back to the drawing board...
Comment #6
TallDavid commentedLet me know if I can run some tests to help isolate the root cause...
Comment #7
nancydruYes, I need to know if you have a block which should be returning no Quotes -- for example a filter that eliminates everything. I think this is the case. Also, tell me if you are using timed blocks ("Update every").
Comment #8
TallDavid commentedNancy,
I have one block configured for Quotes on this site. I don't think I have any filters that eliminate everything, but, I'm uploading a screen shot of the block settings screens in case I'm missing something.
Comment #9
nancydruYes, it's a timed block. I was finally able to reproduce the problem.
You'll see:
Add an else for the second if:
Let me know, please.
Comment #10
TallDavid commentedThe patch has been applied and no errors have been seen since the patch was applied. I will continue to monitor and will close this issue if no further errors are seen.
Thanks!
Comment #11
nancydruPlease mark it as "patch (to be ported)" instead. That way it reminds me to make sure it gets done.
Comment #12
TallDavid commentedBefore the patch I was getting many errors in a 10 minute period. Now, 2 hours after applying the patch, we have not seen any further errors. It looks like you nailed this one Nancy. Thanks for your rapid response!
Comment #13
nancydruGreat. Thanks for testing it and letting me know.
Comment #14
petey318 commentedHi there - likewise, thanks for looking into this. I'm using the module on my site and was getting the same error. I've applied your patch and all seems good.
Cheers & thanks
Pete
Comment #15
nancydruGreat. Thanks. As soon as I finish porting the Bios change to 6.x, I'll be able to commit this.
Comment #16
petey318 commentedOne new thing which I have found today is that if I now go to admin/logs/updates (i'm running the update status module), I get whole bunch of mysql errors ("mysql database has gone away"). If I disable the quotes module, the problem goes away. Possibly it is the way that I added in the patch code (i'll check) but it's probably something else that you may want to check before doing the next commit...
Please let me know if you need me to check anything further, however I will be off-line for a couple of days.
Cheers
Comment #17
nancydruThis fix will in the next commit. I can't see how it would make the database go away.
Comment #18
dgrant commentedThanks for the fix. Works great.
Comment #19
nancydruFix committed to both branches.
Comment #20
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.