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

zabelc’s picture

Hate 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.

cezaryrk’s picture

which 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

zabelc’s picture

I 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.

oregonwebsiteservices’s picture

I 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

Steven.Pescador’s picture

The addition of this line of code took away the notices for me, using the latest dev versions. Thanks.

simonknight’s picture

Hi oregon-website, Apply this patch to the advanced forum module:

http://drupal.org/node/1124116

BrightBold’s picture

Subscribe. 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!

oregonwebsiteservices’s picture

thank you simonknight you are a star!

enxox’s picture

patch works for me too with the latest devs

karilu_ec’s picture

I 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!

KarenS’s picture

Status: Active » Fixed

Fix applied. There may be a more elegant solution, but this works for now. Thanks :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.