Invalid argument supplied for foreach() error in a custom view I wanted to display a table vertically and I found some code to do so, but I'm getting the following error:


warning: Invalid argument supplied for foreach() in site/modules/views/theme/views-view-table.tpl.php on line 35.


Line 35 contains the following code: &lt;?php foreach($row['title'] as $title): ?&gt;.

If I comment out that line, the table stops to be displayed vertically. I read on drupal.org forums that modifying the user's view permissions was a way to resolve, but I granted all permissions to views and I am still getting the same error.

How can I avoid the error appears?
I fixed it..anyone using views hacks will need to nest the above statement in an php if statement to ensure there is data in the array.