Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Note: this worked previously but it seems to have broken in the latest version of Views 6.x-2.7
If I may be so bold. I believe it has to do with how views is now rendering the output of the counter.
From views/handlers/views_handler_field_counter.inc:
<?php
function render($values) {
// Note: 1 is subtracted from the counter start value below because the
// counter value is incremented by 1 at the end of this function.
$count = is_numeric($this->options['counter_start']) ? $this->options['counter_start'] - 1 : 0;
$pager = $this->view->pager;
// Get the base count of the pager.
if ($pager['use_pager']) {
$count += ($pager['items_per_page'] * $pager['current_page']) + $pager['offset'];
}
// Add the counter for the current site.
$count += $this->view->row_index + 1;
return $count;
}
?>
Comments
Comment #1
morbiD CreditAttribution: morbiD commentedThis won't be fixed in views. See http://drupal.org/node/647694#comment-2338198
merlinofchaos suggests that
$fields = $this->rendered_fields
should now be used instead of trying to render the field again in views_cycle unnecessarily.Comment #2
Mac Clemmens CreditAttribution: Mac Clemmens commentedHow would I do that? In views using customfield?
Comment #3
FiNeX CreditAttribution: FiNeX commentedsubscribing
Comment #4
Crell CreditAttribution: Crell commentedviews_cycle has been updated to use ->rendered_fields in the latest dev, so that should take care of this as well.
Comment #5
Crell CreditAttribution: Crell commentedviews_cycle has been updated to use ->rendered_fields in the latest dev, so that should take care of this as well.
Comment #6
Crell CreditAttribution: Crell commented