Closed (fixed)
Project:
Internationalization
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2008 at 01:31 UTC
Updated:
10 Aug 2008 at 18:33 UTC
Drupal Views allows creation of a View without explicitly defined fields. If you are creating a List view, you don't need to define fields. However, i18ntaxonomy module assumes that any view always has an array of fields, and on line 578, in function i18ntaxonomy_views_pre_view(&$view, &$items) uses the a 'foreach' without first checking if the argument of foreach is an array. This leads to a PHP warning, as soon as you enable the module, if you have a view without explicitly defined fields.
You will get a nasty warning like the following:
warning: Invalid argument supplied for foreach() in /...deleted.../sites/all/modules/i18n/i18ntaxonomy/i18ntaxonomy.module on line 578.
FIX: please add the check before the foreach so the code reads something like:
if ( ! is_array($view->field)) { return; }
foreach($view->field as $index => $data) {
Comments
Comment #1
nexxer commentedThanks irakli, this fixed it for me
Comment #2
Alan Oliveira commentedthanks!
it works just fine add this code on line 578 =)
Comment #3
Alan Oliveira commentedComment #4
jose reyero commentedComment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.