I just open the issue, because the patch wasn't commited, and i really don't like my old code.

This patch was created by overall at http://drupal.org/node/430068#comment-1690684

(sorry for my english)

I added "row_index" field to "view" object.
This allow optimize this field handler.
For every field handler: "$values == $this->view->result[$this->view->row_index]" is true.
This will allow replace

    // Add the counter for the current site.
    $count += array_search($values, $this->view->result) + 1;

with

<?php
    // Add the counter for the current site.
    $count += $this->view->row_index + 1;
?>

This replacement already in the patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

     foreach ($keys as $id) {
+      $view->row_index = $count;
       $renders[$count][$id] = $view->field[$id]->theme($row);
     }
   }

Why set $view->row_index more than one time, even its not needed.

I updated this part.

dawehner’s picture

So here is a new version, what changed since last patch:

  1. Remove array_search and replace it with $view->row_index
  2. Init $view->row_index with 0 again E_STRICT erros
superbaloo’s picture

that's looks okay for me :)

I'm on crack. Are you, too?

superbaloo’s picture

Status: Needs review » Reviewed & tested by the community

Forgot the status

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed!

Status: Fixed » Closed (fixed)

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