I'm getting the following error in IE but not in Firefox when I open the link to my view:

warning: Invalid argument supplied for foreach() in /home/.urena/ccd/drupal/sites/all/modules/views/theme/views-view-fields.tpl.php on line 22.

Line 22 is: foreach ($fields as $id => $field):

I'm sorry but the code is pretty much Greek to me.

My site is multilingual so I built the view using Insert a View module 6.x-1.x-dev. And used the Insert a View code to place the view inside a page. Works great in FireFox but in IE I get the error followed by my grouping feilds, which display properly.

I also get an error in both FF and IE when I enable the default glossary view and then select the link (this predated Insert a View):

warning: Invalid argument supplied for foreach() in /home/.urena/ccd/drupal/sites/all/modules/i18n/i18ntaxonomy.module on line 578.

And line 578 is: foreach($view->field as $index => $data) {

Am I doing something wrong or are there bugs with Views and internationalized sites? Thanks for any help, tips or options to try.

Comments

merlinofchaos’s picture

Can you please export the view in question?

warning: Invalid argument supplied for foreach() in /home/.urena/ccd/drupal/sites/all/modules/i18n/i18ntaxonomy.module on line 578.

This error is in i18n module, not Views, and should be filed as a separate issue.

meruthecat’s picture

Thanks, it's posted with the export here: http://drupal.org/node/280407

merlinofchaos’s picture

If it's possible, I'd like you to try this view without i18n active and see if it still generates the error. I don't see anything that should create that error and, in fact, the variable that it's accessing should absolutely not be empty, so I am concerned that maybe something external is corrupting this variable.

meruthecat’s picture

I have a second site running off the same install and when I enable the default Glossary view, it works fine. Then I disabled i18n and the related components on the problematic site and the view also worked. So I enabled the i18n components one-by-one as was able to isolate Multilingual Taxonomy as the one that is creating the error.

Since Multilingual Taxonomy was creating the glossary view error, I tried this test on the views-view-fields.tpl.php error I was getting in IE and it is also this component causing the conflict.

Does this help nail the problem at all or should I just post this information in the i18n thread? It seems clear that the problem has to do with i18n and Multilingual Taxonomy.

merlinofchaos’s picture

Please post that on that thread, and reference this thread. We'll leave this open until we determine where the problem is, but for now I suspect i18ntaxonomy is doing something incorrect or mildly incorrect.

meruthecat’s picture

Ok, it's posted here: http://drupal.org/node/280407.

Thanks for the help.

jose reyero’s picture

Status: Active » Closed (duplicate)

Yes, i18n was not up to date with latest views. Now views is close to a stable release, I'll be updating i18n accordingly

Please, follow up on the i18n thread,

http://drupal.org/node/280407