I installed webform and created some components of type email, select, textfield and textarea.
Preview worked fine in Admin.
When I saved the webform and clicked the link that the webform created in the Menue this shows up:

Fatal error: Cannot use object of type views_handler_field_node as array in ... \sites\all\modules\i18n\i18nviews\i18nviews.module on line 74

Now I am not able to access any webpage of the drupal installation. Not even the Admin Pages.
So I can't roll back.

Please help.

CommentFileSizeAuthor
#8 i18nviews.patch539 byteslord_of_freaks

Comments

rcombes’s picture

While this is being fixed, you can make the following repair...

At line 74, change i18nviews.module (/sites/all/modules/i18n/i18nviews) to read...

if(is_array($data)) {
  if ($data['id'] == 'term_node.name') {
    // That's a full taxonomy box.
    $view->field[$index]['handler'] = 'i18ntaxonomy_views_handler_field_allterms';
  }
  elseif (preg_match("/term_node_(\d+)\.name/", $data['id'], $matches)) {
    $vid = $matches[1];
    if ($translate[$vid]) {
      // Set new handler for this field.
      $view->field[$index]['handler'] = 'i18ntaxonomy_views_handler_field_allterms';
    }
  }
}

By adding is_array just before line 74, the system will check that $data is valid. This unstuck my system and I hope it works for you.

Cheers
Roland Combes

quicksketch’s picture

Project: Webform » Internationalization
Version: 6.x-2.7 » 6.x-1.2

Seems like an i18n issue to me. Webform doesn't even have Views integration.

phpberlin’s picture

hi there
i guess its an issue to module finder ..

i dont use webforms and have the same problem
http://drupal.org/node/595160

@paul: thanks for the fixed code. but it doenst work for me..
if i insert the code the error is gone
and the output of the views taxonomie list is gone too

thomjjames’s picture

Hi,

I can confirm this error also.

It only seems to happen with views that have taxonomy arguments or filters and only with "fields" row display. Using node row display does not cause the error.

If I get time i'll try to submit a patch for this.
Tom

rickvug’s picture

Category: support » bug

This is now a bug report, not a support request.

Guty’s picture

I just run into same issue but with module version 6.x-1.3 and line 144.
Error message looks like this:
Fatal error: Cannot use object of type views_handler_field_node as array in /i18n/i18nviews/i18nviews.module on line 144

The repair mentioned in #1 fixes this issue. Seems to me that line 74 in version 6.x-1.2 is now line 144 in version 1.3.
This has nothing to do with module webform in this case.

maijs’s picture

It's weird that there is an assumption that $data is an array as Views object there is exactly that - an object.

lord_of_freaks’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new539 bytes

Works for me

Simple such as:


// ... code

$data = (array) $data;

// ... code

Just cast $data inside the functions into an array ... and it works!!!!

jose reyero’s picture

Project: Internationalization » Internationalization Views
Version: 6.x-1.2 » 6.x-2.x-dev
Status: Patch (to be ported) » Postponed (maintainer needs more info)
blecheimer’s picture

thank you! #8 worked for me... 6.x-2.0

Junro’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Patch #8 works with 2.0 branch.

YK85’s picture

susbscribing

perandre’s picture

I still get this error message when i go to a view in a non default language:

Fatal error: Cannot use object of type content_handler_field_multiple as array in /var/www/sites/all/modules/i18n/i18nviews/i18nviews.module on line 144

It only happens with one view in a panel, and only when using the url alias, it seems.

gease’s picture

Status: Reviewed & tested by the community » Needs work

All these errors happen in i18nviews_views_pre_view function, isn't it? I'm getting the same for line 124 that reads if ($data['id'] == 'term_node.name') {. This function doesn't seem to make any sense, except breaking the view. Translating taxonomy terms seems to be partially solved in #845616: i18n taxonomy: translating standard Views taxonomy term field.