I've read every line of all the advanced_render() issues present over the last couple days... However, in my circumstance, It is still occurring in 2.10 version...
Fatal error: Call to a member function advanced_render() on a non-object in /var/www/imbee/sites/all/modules/contrib/views/theme/theme.inc on line 236
For me this is happening when trying to include a custom override template at the module level for the row output...
/**
* Implementation of hook_theme()
*/
function imbee_comments_theme() {
return array(
'views_view_fields__comments' => array(
'template' => 'views-view-fields--comments',
'path' => drupal_get_path('module', 'imbee_comments') . '/theme',
'arguments' => array('view' => NULL, 'field' => NULL, 'row' => NULL),
'original hook' => 'views_view_field',
'type' => 'module',
'preprocess functions' => array('template_preprocess', 'template_preprocess_views_view_field'),
),
);
}
commenting out the preprocess line here will remove the error, but also lose the content obviously.
The custom tpl.php right now defined in views-view-fields--comments.tpl.php is the exact default code provided in the views-view-fields.tpl.php in the core views templates.
If I place this template in the theme folder, and remove the hook_theme() from my module, clear the cache... the issue goes away....
This is only happening trying to declare the theme function on the module level (which I do need in this case)
Merlin... yes, this is imbee! ;) Kory says hi!
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | views-theme-advanced-render-non-object-field-alias.patch | 576 bytes | Anonymous (not verified) |
Comments
Comment #1
merlinofchaos commentedThis error happens because an invalid field ID is being rendered. Perhaps there is something wrong in your custom theme that is trying to render a field that does not exist?
Comment #2
himerus commentedI've managed to currently skirt the issue by using the theming at a different level of the views templating, BUT when this issue was present, the template that was being called was the exact same code provided in the default row style output template provided in the views folder, and in the theme information... Was on a comment type view... with all standard fields... hrm... I'm just not positive... I debugged until I was blue in the face, and found an alternative method, which just goes one level up to the style output level rather than the row level.
Comment #3
merlinofchaos commentedIf you can give me reproduction instructions from a clean install, that would really be handy in figuring out what's wrong. It's hard to tell what'sg oing on here.
It does suggest to me that I should probably add validation to this function so that, in the worst case, we don't crash. It won't render anything but that's better than a whitescreen if this kind of thing keeps coming up.
Comment #4
merlinofchaos commentedComment #5
esmerel commentedNo updates in more than 30 days.
Comment #6
Anonymous (not verified) commentedAfter upgrading to Views 6.x-2.11 I am experiencing this error in conjunction with views_crosstab. Note, there was no error using views_crosstab with an earlier version of Views (2.8 I think).
The error is:
To generate node totals using views_crosstab, I discovered that field id = 'nid', and the field_alias = 'some_other_field_total'. In the view the fields array contained the $field->field_alias as the id, and not $field->options['id'].
I therefore changed line 225 in views/theme/theme.inc to:
Patch attached.
Not sure if this sheds any light on the problem, or whether in the opinion of views module developers, views_crosstab is incorrectly using field_alias?
Comment #7
AntiNSA commentedI am receiving the exact problems as #6. I want to add the patch , but am afraid it will destroy views. is this a safe patch to use with views 2?
Comment #8
dawehnerTry it out. That's the reason for patches.
Comment #9
AntiNSA commentedseems to work.
Comment #10
merlinofchaos commentedThere's something else going on here.
I can't think of any circumstance in which the field_alias used should actually be the index of the field for advanced rendering. I would love to see some debug information showing me a situation where this is the case.
Comment #11
lecterro commentedThe question is what should be replaced in line 225. In my file there is some comment on that line. Should it be the function: function template_preprocess_views_view_field(&$vars) edited?
Comment #12
iamjon commentedhi,
does anyone have updated information about this issue or can provide replication instructions and an export?
marking this as postponed
Comment #13
iamjon commentedI'm marking this as closed. Please feel free to reopen with more information
Comment #14
chalu commentedHello all, I've been having this same problem and applied the patch suggested, but now I have another error :
warning: Invalid argument supplied for foreach() in .../sites/all/modules/views_crosstab/views_crosstab_table.inc on line 82.
maybe this a what is stopping my crostab table from showing well. I want to build a "medals table / tally" similar to http://www.cwgdelhi2010.org/medal-tally. I have a node type called "medal entry" with which we intend to enter data for winners, it captures the athlete, institution (instead of country) and then a drop-down to select the medal which is either Gold, Silver or Bronze.
Displaying this as a normal views table, it will render like this
However I want this instead :
which is what the crosstab module sets out to achieve in the first place. Ok, but how do I configure it, what should I choose / select under Crosstab rows, Crosstab columns and Crosstab data ?
Please help ??
Comment #15
dreamer777 commentedchalu, i have the same problem with the same warning. did you manage to solve it?
Comment #16
eft commentedFYI - A new D7 version of views_crosstab has been committed to a development branch. Please try it and create a new issue for any problems identified. Development is occuring on D7 branch only.