Posted by nimi on November 9, 2009 at 12:45pm
Jump to:
| Project: | Internationalization |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I have a node that outputs a view. Once I enabled the multilingual option for that node and then tried to see the node i got:
Fatal error: Cannot use object of type views_handler_field_node_link_edit as array in C:\xampp\htdocs\drupal-6.14\sites\all\modules\i18n\i18nviews\i18nviews.module on line 74The code I use to output the view inside the node is:
$view1 = views_get_view('publications_books');
$view1->set_display('default');
$output_view1 = $view1->preview();
if ($view1->result) {
print $view1->execute_display('default');
}I tried to comment out the whole section that belongs to i18nviews.module on line 74 and it seems to work.
However, I would like to know if there is any danger in doing this?
Thanks!
Nimi.
Comments
#1
Help anyone? Please...
#2
Solved it!
i changed the code I used to display a view to:
views_embed_view("publications_articles","publications_block");
Thanks.
Nimi.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
I had the same error but had no clue as to what was precipitating it so I made the following repair...
At line 74, I changed 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';
}
}
}
The addition of is_array just before line 74 provided a check for $data validity as an array and prevented it from throwing an error when it received an inappropriate value.
This unstuck my system even though it didn't really provide much of a clue as to why the $data value managed to go wrong.
Cheers
Roland Combes