Hello ,

I 've been trying for days ...and looked in the archives ..

warning: Invalid argument supplied for foreach() in :\hshome\myname\modules\views\theme\views-view-table.tpl.php on line 22

It shows up on every page that display data from the DB for anonymous user in and no data on the page !!!!!!!

However,for authenticated user there's no warning message and you can see all the tables' data. Everything is working fine

I created a cck table with 5 columns.
On line 22 of views-view-table.tpl.php as it says in the error msg I have this

: foreach ($header as $field => $label):

Comments

GPirie’s picture

I have the same problem for a site that I'm working on, can anyone help?

http://graemepirie.com

GPirie’s picture

I have it sorted!

Navigate to User Management>>Permissions and then alter the permissions within the content_permissions so that anonymous users are able to access the views content.

http://graemepirie.com

WillBrown’s picture

Thank you very much for replying. That fixed the problem for me!

carj’s picture

I'm gonna try that .

Thank you

Natalie-1-1’s picture

This fixed it for me, thanks!

Curious Stu’s picture

It's exactly the same as above, same warning, same line. I have changed the permissions to alow full access to the views but it doesn't like it. Displayed as both a block and a page perfectly for authenticated users. Anonymous users get the nasty warning.

Sorted it, it did work. Long day eyes full of grit and can't see past my nose.

anektod’s picture

warning: Invalid argument supplied for foreach() in C:\wamp\www\sites\all\modules\views_popup\views-view-popup-table.tpl.php on line 22.

row 22 ==> foreach ($popup_headers['displayed'] as $field => $label):

where is the problem ?

jordojuice’s picture

Are you using Content Permissions? Did you check your content permissions as they mentioned above?

anektod’s picture

oppss !!
So soryy
administer permissions is null ..
Now try and problem resolved
thanx for reply

jordojuice’s picture

Great!