This is the error message I get in the top pink error box above the content when Organic Groups teampage is called. I don't know what's wrong. Let me know if you need anything further.
warning: Invalid argument supplied for foreach() in /home/domain/public_html/subdomain/modules/views/views_query.inc on line 81.
warning: Invalid argument supplied for foreach() in /home/domain/public_html/subdomain/modules/views/views_query.inc on line 16.
warning: Invalid argument supplied for foreach() in /home/domain/public_html/subdomain/modules/views/views_query.inc on line 189.
warning: Invalid argument supplied for foreach() in /home/domain/public_html/subdomain/modules/views/views_rss.module on line 55.
Comments
Comment #1
merlinofchaos commentedOk, the error message suggests a non-working $view is being sent to views_build_view. What module supplies the og teampage? I'm not sure -- but we should reassign this issue to that project to see if they can figure out what's going on here.
Comment #2
drupalgirl commentedOrganic Groups module controls Organic Groups teampage module. Must create a view og_ghp_ for success. Only Views whose names start with og_ghp_ are eligible. Views module returns a blank page for view ADD so cannot create the view for OG.
Without ability to add a view, OG directory homepage returns Page Not Found further impacting anything associated with OG home pages, including OG teampage. Other cases submitted suggested increasing system memory so memory was increased to 64 MB, but still blank page returns when attempting to ADD a view in View module.
Comment #3
marcbe commentedI too get that warning. The first time I noticed this, I did not pay much attention to it. But once this warning showed sup, if I edit the parameters in the corresponding views propriety page, it will end up in a corruption of the database and all the data refered to by this view wont be displayable (by using the view at least).
At the time, i did not see other solutions than to recreate the views from scratch. This somehow cured these warnings... Then the other day, i log back in and the warnings came back. Could it be caused by the cron that is ran every day?
What I get is: "warning: Invalid argument supplied for foreach() in /home/mysite/public_html/includes/form.inc on line 945."
This warning seems to be more than just a warning as it can potentially (it seems) corrupt a database. Anyone has any ideas what this could be cause by, etc?
Thanks for the help
Comment #4
marcbe commentedTo follow up on this, I still got this problem and it is quite problematic as it prevents me from changing any view configuration.
Also, note that I am not using organic groups.
Any clues on what could be causing this? It seems to be more related to the views side than the custom CCK node data itself as I can use these custom CCK nodes even if the views configuration menu gives the warning at the top.. as long as I don't edit that views config once I see the warning message.
It is like if something in the Drupal site database was annoying the views module at some point and causing it to corrupt the DB if you try re-saving a view config.
Thanks for the help
Comment #5
drupalgirl commentedGood luck friend. I have been dealing with this issue for some time now. See my other post at http://drupal.org/node/132563 regarding this. I got a little feed up. Would you post whatever you've learned that might make this Views mod thing easier on the rest of us poor forgotten souls?
Comment #6
ddyrr commentedI have the same error, and found that it goes away when users are members of at least one group. On my site in particluar, it had to do with "Author Group" being empty when submitting new nodes. When a user is a member of a group, that field gets filled in and the error goes away. I didn't see any options to get rid of that field when it's empty
Comment #7
ddyrr commentedBy the way, mine had to do with the error:
warning: Invalid argument supplied for foreach() in /home/socia12/public_html/includes/form.inc on line 949.
Comment #8
skor commentedSomething is broken between Organic groups and Views. Some more info here.
Comment #9
bekabug commentedI have this same problem and I am not using Organic Groups.
* warning: Invalid argument supplied for foreach() in /home/user/public_html/modules/views/views_query.inc on line 81.
* warning: Invalid argument supplied for foreach() in /home/user/public_html/modules/views/views_query.inc on line 16.
* warning: Invalid argument supplied for foreach() in /home/user/public_html/modules/views/views_query.inc on line 195.
I used this tutorial to create a gallery for my site and aside from events and signups, those are the only other non-core modules I am running. http://drupal.org/node/144725
When you click on the image, thickbox opens it, but when you click on the images' title link it takes you to domain.com/whatever-you-titled-the-picture; this page is where the errors appear for me. As a workaround I have edited the view and turned off the title as a link and I'm happy with that. I wanted to interject that I don't think this issue is specifically related to OG in tandem with Views.
Comment #10
bekabug commentedComment #11
mrgoltra commentedGood Day All,
Any work around on this problem? This error is filling up my log entries like crazy, I already changed the time when cron runs and also checked the access log database size and it is almost at 35MB.
Thank you,
Mark
Comment #12
codenamerhubarb commentedIt might be because you haven't enabled your view as either a page or a block. Just double check.
Comment #13
mrgoltra commentedIt is set to page.
Comment #14
13mhz commentedMaybe it's nothing brilliant, but i have get rid of those erros after uncommenting one line in .htaccess file in drupal root directory (it should be about 80 line in fresh file):
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /drupal
I have drupal in a subdirectory, http://kapa.pl/drupal/
I have read handbooks pretty carefully and found nothing about this line in htaccess.
Hope this help you, folks!
Comment #15
messenger commentedYep,
That solves it for me as well.
Comment #16
catchThis looks like a drupal configuration issue rather than a views bug (or at least a very minor views bug), so I'm reclassifying. If anyone can reproduced this error with the rewrite base set correctly that'd be handy.
Comment #17
juroon commentedI was getting this error on my Administer » User management » User settings pages on three of five sites on my multi-site setup:
warning: Invalid argument supplied for foreach() in / [blah] / [blah] / [blah] /files/includes/form.inc on line 949.
warning: Invalid argument supplied for foreach() in / [blah] / [blah] / [blah] /files/includes/form.inc on line 949.
These sites are all new, and the ones with the error were not live yet.
I tried all sorts of things to track down the problem, but after reading the above info I started looking closely at views. I didn't have any custom views set up on two of the pages, so I figured it had to be a module view. There were no modules unique to those three sites out of my five, so I just started uninstalling modules one at a time from the site with the fewest modules enabled. I suspected I installed the wrong version of something.
The problem turned out to be with ImageCache Profiles 5.x-1.3, or rather, my installation of the module. I had failed to read the installation readme.txt which explains you need to set some imagecache presets before you turn on the module. The problem did not appear on another site with that module because I just happened to have some presets already set up before I enabled the module there.
I guess that confirms in my case this was a configuration issue, but I'm not sure you'd call it a Drupal configuration issue. In my case I'd call it a (newbie) module configuration issue. Anyway, I wasted enough time on it to call it all sorts of other things, so I figured it might be worth it to somebody if I post this reminder: Read the readme.txt's for your modules. Even if you think you always read them, if you're getting this error, you might want to try reading them again.
Comment #18
yersin commentedThanks for helping. I get this error after I search for certain words. I think that the problem occurs when the search finds the searched word in pages that the user doesn't have permission to access to. In my case, when I log in as admin and I search for "question", I don't have any problems. However, if I log in as a user, after searching for "question", i get this message:
Access denied.
* warning: Invalid argument supplied for foreach() in /home/e-smith/files/ibays/tzone/html/modules/taxonomy/taxonomy.module on line 1329.
* warning: Cannot modify header information - headers already sent by (output started at /home/e-smith/files/ibays/tzone/html/includes/common.inc:388) in /home/e-smith/files/ibays/tzone/html/includes/common.inc on line 141.
What is even more unusual is that I get many pages with these warnings, each page with the logo, the menus, etc., one page after another. The last page shows the results. The problem must occur because there are many quiz questions that have the word "question " in them, so users can't access them through the search.
Am I reporting this problem in the right place?
Comment #19
heather commentedJuroon! You win prizes! Thank you! I had the same error:
warning: Invalid argument supplied for foreach() in /includes/form.inc on line 949.... it was exactly as you said. I didn't read the readme.txt, and so the presets weren't there when I enabled. I was in the same situation, no modifications yet, no views, just setting up the site.
Thanks for posting your solution. I add my 2 cents here to give it a bump in the results.
Comment #20
bflora commentedI just wanted to report that I had this problem too, and it was solved by simply turning on and off the ImageCacheProfile module. SCORE
Comment #21
maverick14 commentedHello,
Can anyone help me with this one:
* warning: Invalid argument supplied for foreach() in /Users/solide/Documents/www-docroot/drupal5/modules/user/user.module on line 673.
* warning: Invalid argument supplied for foreach() in /Users/solide/Documents/www-docroot/drupal5/modules/user/user.module on line 673.
Comment #22
catchmaverick14: Unless your bug relates directly to this issue (views and organic groups) please open a new support request rather than bumping old issues. Additionally you need to supply information about your Drupal install alongside bug reports - particularly which modules are enabled.
Comment #23
dugh commentedSee same bug as soon as I upgraded to organic groups 5.x-7.3.
The ogr river of news view is gone. Even after uninstalling and reinstalling it is not recreated.
Comment #24
jinqiu commentedThat is not because the element in foreach is not an array?
I use
if(is_array($_element))
{
foreach($_element as $value)
}
and all issues are disappeared.
Comment #25
bergco commentedThanks, that did it for me!
Comment #26
sunComment #27
Lios commentedI have the same problem with one of my views. It turns out that in the filter I use the option 'Taxonomy: Terms for Type page' and suddenly this disappeared. I can no longer filter on taxonomies per content type. Any idea how this can be suddenly gone, without anyone touching it, and, more importantly, how to get it back?
edit: It turned out that the views have their own cache. When I emptied that, the problem was solved and I can select the taxonomies per content type again, too. So, no idea what was wrong, but at least it's solved now.
Comment #28
merlinofchaos commentedThis will not be fixed in Views 1.
Comment #29
jayashreeb commentedHi,
* warning: Invalid argument supplied for foreach() in /home/sotite/public_html/sites/all/modules/views/includes/handlers.inc on line 807.
* warning: Invalid argument supplied for foreach() in /home/sotite/public_html/includes/common.inc on line 1637.
i am getting the error like this. what to do for that .any one can give the suggestion.
Thanks for advance
Comment #30
farid123 commentedI was able to remove this warning messages by deleting the cash :
On the "Administer > Site configuration > Performance" page, click on the "Clear cached data" button
cheers
Farid
Comment #31
christensen143 commentedI resolved this issue through the permissions page. I had created two types of content but had not given permission to view that content. After giving permission the error went away. :)
Comment #32
devsanjeev commentedHi,
Can anyone help me to resolve this warning msg.
"warning: Invalid argument supplied for foreach() in /home/bldevsit/public_html/....../cms/includes/form.inc on line 1430."
Comment #33
chilledweb commentedhi Guys - we had this problem on one of our customer sites - after we moved a Drupal install from our development to our live servers - the problem was fixed by clearing the cache on the live server. Clearly it was carrying old data that was messing with the views. Problem solved, I hope it helps.
Comment #34
videographics commentedOk, now I'm in trouble. I've got this error coming up. "warning: Invalid argument supplied for foreach()..." Now, with every page load, my system log gets filled with about 1000 pages of junk.
I see people have been having problems with this for over 3 years but I cannot see any clear answer as to how to address this. I can't even find any guidance as to how to effectively troubleshoot this.
I see it's been attributed to all sorts of things -- Views, Taxonomy, Organic Groups, etc. (Is this the right issue queue for this to be posted in?)
I see it's been solved by all sorts of things -- emptying caches, moving to a new server, tweaking code, changing permissions, etc.
Where do I start?!!!
I've tried emptying caches, removing various modules (I don't use dev versions of anything or anything esoteric), but I'd appreciate some guidance before I start ripping my whole installation apart.
Also, where do these Views versions beyond 6.x-2.12 come from (like 6.x-2.8)? My updates show 6.x-2.12 is current as does the Views page on Drupal.org and the Releases for Views page (http://drupal.org/node/38878/release)
Please help!
Comment #35
videographics commentedSolved it by disabling a whole bunch of modules -- NOT views. I'll try to report back once I find the culprit.
Comment #36
catchComment #37
iamjon commentedvideographics,
if you're still having trouble please feel free to open a new issue.
This issue was rightfully closed in september 2009. Afterwards most of the messages were workarounds and solutions.
Comment #38
francewhoa@christensen143: Thanks for your comment in #31. It works :)
@All: To fix this we set appropriate permissions on the CCK fields at
/admin/user/permissionsIf that doesn't work then clear your Views cache at/admin/build/views/toolsComment #39
finaukaufusiI had experienced this error before but I managed to fixed.
On your form, there are some field type are suppose to be an array. For example:
Okay, the default value of these item type will always be an array()
If you programmatically assign a default value to these item type, make sure it's an array not a string " "
To fix this problem, you set your default values like the following:
That will make sure your default values will always be an array.
Hope it will help someone :)
Finau
Comment #40
barresoft commentedSimple solution:
edit the wrong file and consider it:
if(is_array($_element))
{
foreach($_element as $value)
.
.
.
}
and all issues are disappeared.