Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (line 1178 of /sites/all/modules/views/handlers/views_handler_field.inc).
in the calendar demo view, when i click on "week" i've got this notice, the solution was to add $field->view->row_index = $num
// File: calendar/theme/theme.inc
// LINE: 153 in function template_preprocess_calendar(&$vars)
// (...)
foreach ($fields as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if ($field->real_field == 'entity_id' || $field->real_field == 'revision_id') {
$items[$num]->id = $row->{$field_alias};
//$col = $field->definition['field_name'] . '_' . $field->options['group_column'];
//$field_alias = $field->aliases[$col];
}
if (!empty($field) && is_object($field)) {
// Theme the copy instead of the original row so duplicate date
// fields each get a fresh copy of the original data to theme.
$field->view->row_index = $num; // LINE: 164 --- ADD THE FOLLOW LINE
$items[$num]->{$field_alias} = $field->theme($copy);
}
if (!empty($field->options['exclude'])) {
if (isset($items[$num]->{$field_alias})) unset($items[$num]->{$field_alias});
}
}
// (...)
Comments
Comment #1
zabelc CreditAttribution: zabelc commentedHate to say it, but I'm getting the same error repeated for every event on all calendar views (day, week, month, and year), and the above fix didn't resolve it.
Comment #2
cezaryrk CreditAttribution: cezaryrk commentedwhich version of views + date + calendar you use
i installed:
* views-7.x-3.x-dev (6.4.11)
* date-7.x-2.x-dev (6.4.11)
* calendar-7.x-2.x-dev (24.3.11)
with this constallation it works for me and the notice is gone
Comment #3
zabelc CreditAttribution: zabelc commentedI have the following:
views = "7.x-3.x-dev" packaged 2011-04-07
date = "7.x-2.x-dev packaged 2011-04-07
calendar = "7.x-2.x-dev packaged 2011-03-24
From what I've seen your fix should have worked, but I've cleared my caches several times, and I get that message once for every event in my system.
Comment #4
oregonwebsiteservices CreditAttribution: oregonwebsiteservices commentedI am getting the same exact error message:
•Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (line 1187 of /var/www/vhosts/humanhighlights.com/httpdocs/sites/all/modules/views/handlers/views_handler_field.inc).
•Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (line 1187 of /var/www/vhosts/humanhighlights.com/httpdocs/sites/all/modules/views/handlers/views_handler_field.inc).
But I am not using calendar on this site, it appears when I go in to any of the forums I have configured you can
see it here: http://humanhighlights.com/forums/oregon-high-school-football
It seems to occur six times for every topic posted in a particular forum
Dowloaded the latest
Views 7.x-3.x-dev (2011-Apr-09)
Advanced Forum 7.x-2.0-alpha1
Comment #5
Steven.Pescador CreditAttribution: Steven.Pescador commentedThe addition of this line of code took away the notices for me, using the latest dev versions. Thanks.
Comment #6
simonknight CreditAttribution: simonknight commentedHi oregon-website, Apply this patch to the advanced forum module:
http://drupal.org/node/1124116
Comment #7
BrightBoldSubscribe. Fix in OP worked for me but I'll need to remember where to find this post when I upgrade Date and overwrite all the patches!
Comment #8
oregonwebsiteservices CreditAttribution: oregonwebsiteservices commentedthank you simonknight you are a star!
Comment #9
enxox CreditAttribution: enxox commentedpatch works for me too with the latest devs
Comment #10
karilu_ec CreditAttribution: karilu_ec commentedI was getting the same error but in line 1208 when looking at the calendar page.
Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (line 1208
I started seeing that error when I upgraded to the development version of Views.
Sure enough the fix works!
Comment #11
KarenS CreditAttribution: KarenS commentedFix applied. There may be a more elegant solution, but this works for now. Thanks :)